GitHub user jhelie opened a pull request:
https://github.com/apache/libcloud/pull/1080
Fix alerts found with lgtm
### Description
This fixes more issues flagged by lgtm.com code queries. Most were
minor/style but a few were errors meaning the code did not have the intended
effected (e.g. ```if x == a or b``` instead of `if (x == a) or (x == b)```
The standard lgtm deep code analysis highlights dependencies,
vulnerabilities (3 found, see
https://lgtm.com/projects/g/apache/libcloud/vulnerabilities) and currently flag
156 alerts - but you can investigate further by writing custom queries to
explore your code base (https://lgtm.com/docs/ql/about-ql).
(PR integration can also help automatically check for potential issues -
for instance I haven't looked into it yet but it seems that
2a450e4072c0468440877ec3decf3b21eaf369fa may have introduced a few potential
issues
https://lgtm.com/projects/g/apache/libcloud/rev/2a450e4072c0468440877ec3decf3b21eaf369fa
)
### Status
- done, ready for review
### Checklist (tick everything that applies)
- [x ] [Code
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
(required, can be done after the PR checks)
- [ ] Documentation
- [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ]
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
(required for bigger changes)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jhelie/libcloud fix-alerts-found-with-lgtm
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/1080.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1080
----
commit 6b4bf02b00fc29301eb0aa6d76bedcf1d43a252b
Author: jhelie <[email protected]>
Date: 2017-06-22T12:25:42Z
fix badly raised exceptions
commit e40e9453ba17d852d6c97d40b0a649649c9492f8
Author: jhelie <[email protected]>
Date: 2017-06-22T12:36:16Z
remove redundant and confusing else statements after a for loop without
break clause
commit d89a7bf854da9b1a881ced67faa4a0a70c919acb
Author: jhelie <[email protected]>
Date: 2017-06-22T12:51:01Z
remove duplicate assignment of dictionary key
commit 43a218bd7aab9d2e949c18e3c4b6289b1c3c248e
Author: jhelie <[email protected]>
Date: 2017-06-22T12:52:08Z
remove unreachable return statement
commit c1c0a7526b90141ec09becc34e3522bf1cbdc24b
Author: jhelie <[email protected]>
Date: 2017-06-22T12:52:41Z
remove unecessary pass statements
commit fe0b2871e986eaacc197a8f3b649bab0221f258e
Author: jhelie <[email protected]>
Date: 2017-06-22T12:57:39Z
fix if statement resulting in unreachable code
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---