Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead python code reported by Vulture #1149

Merged
merged 49 commits into from
May 7, 2021
Merged

Remove dead python code reported by Vulture #1149

merged 49 commits into from
May 7, 2021

Conversation

shreyamalviya
Copy link
Contributor

@shreyamalviya shreyamalviya commented May 6, 2021

Fixes #1123

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?

Testing Checklist

  • Added relevant unit tests?
  • Have you successfully tested your changes locally? Elaborate:

    Running blackbox tests is left

  • If applicable, add screenshots or log transcripts of the feature working

mssalvatore and others added 30 commits May 5, 2021 19:09
Using these specific names prevents Vulture from identifying these
parameters as unused.
…zero_trust/test_common/monkey_finding_data.py`
…by_id()` in `monkey_island/cc/services/node.py`
…TTP` in `infection_monkey/model/__init__.py`
…)`, and `_traceroute_linux` from `infection_monkey/network/tools.py`
…et_region()` from `monkey_island/cc/environment/aws.py`
…_COPY_FILENAME_64` in `infection_monkey/exploit/sambacry.py`
Copy link
Collaborator

@mssalvatore mssalvatore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've stripped out the irrelevant portion of the path from the whitelist and added it.

monkey/common/utils/exploit_enum.py Show resolved Hide resolved
@@ -189,97 +158,6 @@ def tcp_port_to_service(port):
return "tcp-" + str(port)


def traceroute(target_ip, ttl=64):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VakarisZ Are we using traceroute anywhere anymore? If not, can we get rid of everything that references the binaries (e.g. deployment scripts and release documentation).

monkey/infection_monkey/transport/http.py Show resolved Hide resolved
monkey/monkey_island/cc/resources/root.py Show resolved Hide resolved
@@ -17,7 +17,7 @@

class BootloaderHttpServer(ThreadingMixIn, HTTPServer):
def __init__(self, mongo_url):
self.mongo_client = pymongo.MongoClient(mongo_url)
pymongo.MongoClient(mongo_url)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this call achieve if we're not using the object it returns?

@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #1149 (e8947a3) into develop (e609094) will decrease coverage by 0.03%.
The diff coverage is 60.00%.

❗ Current head e8947a3 differs from pull request most recent head 69af8a8. Consider uploading reports for the commit 69af8a8 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1149      +/-   ##
===========================================
- Coverage    28.66%   28.62%   -0.04%     
===========================================
  Files          411      411              
  Lines        12898    12744     -154     
===========================================
- Hits          3697     3648      -49     
+ Misses        9201     9096     -105     
Impacted Files Coverage Δ
monkey/common/cloud/aws/aws_service.py 63.33% <ø> (+7.23%) ⬆️
monkey/common/cmd/cmd_runner.py 0.00% <ø> (ø)
...mmon/common_consts/system_info_collectors_names.py 100.00% <ø> (ø)
monkey/common/utils/attack_utils.py 100.00% <ø> (+6.25%) ⬆️
monkey/common/utils/exploit_enum.py 100.00% <ø> (ø)
monkey/infection_monkey/config.py 65.24% <ø> (-0.25%) ⬇️
monkey/infection_monkey/exploit/sambacry.py 0.00% <ø> (ø)
monkey/infection_monkey/exploit/tools/wmi_tools.py 23.65% <ø> (-1.61%) ⬇️
monkey/infection_monkey/exploit/web_rce.py 0.00% <0.00%> (ø)
monkey/infection_monkey/model/__init__.py 100.00% <ø> (ø)
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e609094...69af8a8. Read the comment docs.

@mssalvatore mssalvatore merged commit aa959c3 into develop May 7, 2021
@mssalvatore mssalvatore deleted the vulture branch May 13, 2021 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dead python code with Vulture
2 participants