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

Sourcery refactored master branch #1

Merged
merged 1 commit into from
Mar 20, 2022
Merged

Sourcery refactored master branch #1

merged 1 commit into from
Mar 20, 2022

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Mar 17, 2022

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Advik-B March 17, 2022 08:06
@pep8speaks
Copy link

Hello @sourcery-ai[bot]! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 227:1: W191 indentation contains tabs
Line 229:1: W191 indentation contains tabs
Line 230:1: W191 indentation contains tabs
Line 230:4: E101 indentation contains mixed spaces and tabs
Line 231:1: W191 indentation contains tabs
Line 231:4: E101 indentation contains mixed spaces and tabs
Line 351:1: W191 indentation contains tabs
Line 354:1: W191 indentation contains tabs
Line 386:1: W191 indentation contains tabs
Line 387:1: W191 indentation contains tabs
Line 387:6: E101 indentation contains mixed spaces and tabs
Line 398:1: W191 indentation contains tabs
Line 405:1: W191 indentation contains tabs
Line 408:1: W191 indentation contains tabs
Line 1008:1: W191 indentation contains tabs
Line 1012:1: W191 indentation contains tabs
Line 1119:1: W191 indentation contains tabs
Line 1125:1: W191 indentation contains tabs
Line 1126:1: W191 indentation contains tabs
Line 1126:4: E101 indentation contains mixed spaces and tabs
Line 1126:8: E129 visually indented line with same indent as next logical line
Line 1127:1: W191 indentation contains tabs
Line 1128:1: W191 indentation contains tabs
Line 1241:1: W191 indentation contains tabs
Line 1317:1: W191 indentation contains tabs
Line 1337:1: W191 indentation contains tabs
Line 1337:13: E231 missing whitespace after ':'
Line 1337:13: E701 multiple statements on one line (colon)
Line 1337:14: E225 missing whitespace around operator
Line 1379:1: W191 indentation contains tabs
Line 1455:1: W191 indentation contains tabs
Line 1455:12: E711 comparison to None should be 'if cond is not None:'
Line 1455:38: W291 trailing whitespace
Line 1492:1: W191 indentation contains tabs
Line 1496:1: W191 indentation contains tabs
Line 1512:1: W191 indentation contains tabs
Line 1517:1: W191 indentation contains tabs
Line 1518:1: W191 indentation contains tabs
Line 1518:5: E101 indentation contains mixed spaces and tabs
Line 1519:1: W191 indentation contains tabs
Line 1519:5: E101 indentation contains mixed spaces and tabs
Line 1519:80: E501 line too long (122 > 79 characters)
Line 1520:1: W191 indentation contains tabs
Line 1520:5: E101 indentation contains mixed spaces and tabs
Line 1523:1: W191 indentation contains tabs
Line 1524:1: W191 indentation contains tabs
Line 1524:5: E101 indentation contains mixed spaces and tabs
Line 1528:1: W191 indentation contains tabs
Line 1529:1: W191 indentation contains tabs
Line 1529:6: E101 indentation contains mixed spaces and tabs
Line 1530:1: W191 indentation contains tabs
Line 1530:6: E101 indentation contains mixed spaces and tabs
Line 1531:1: W191 indentation contains tabs
Line 1531:6: E101 indentation contains mixed spaces and tabs
Line 1531:80: E501 line too long (258 > 79 characters)
Line 1532:1: W191 indentation contains tabs
Line 1532:6: E101 indentation contains mixed spaces and tabs
Line 1535:1: W191 indentation contains tabs
Line 1536:1: W191 indentation contains tabs
Line 1536:6: E101 indentation contains mixed spaces and tabs
Line 1537:1: W191 indentation contains tabs
Line 1537:6: E101 indentation contains mixed spaces and tabs
Line 1538:1: W191 indentation contains tabs
Line 1538:6: E101 indentation contains mixed spaces and tabs
Line 1538:80: E501 line too long (251 > 79 characters)
Line 1539:1: W191 indentation contains tabs
Line 1539:6: E101 indentation contains mixed spaces and tabs
Line 1541:1: W191 indentation contains tabs
Line 1542:1: W191 indentation contains tabs
Line 1542:80: E501 line too long (84 > 79 characters)
Line 1543:1: W191 indentation contains tabs
Line 1544:1: W191 indentation contains tabs
Line 1545:1: W191 indentation contains tabs
Line 1545:6: E101 indentation contains mixed spaces and tabs
Line 1546:1: W191 indentation contains tabs
Line 1546:6: E101 indentation contains mixed spaces and tabs
Line 1547:1: W191 indentation contains tabs
Line 1549:1: W191 indentation contains tabs
Line 1555:1: W191 indentation contains tabs
Line 1558:1: W191 indentation contains tabs

Line 310:80: E501 line too long (157 > 79 characters)
Line 407:80: E501 line too long (93 > 79 characters)
Line 452:25: W605 invalid escape sequence '.'

Line 510:80: E501 line too long (93 > 79 characters)
Line 558:25: W605 invalid escape sequence '.'

tools/power.py Show resolved Hide resolved
tools/power.py Show resolved Hide resolved
tools/power.py Show resolved Hide resolved
tools/power.py Show resolved Hide resolved
tools/power.py Show resolved Hide resolved
tools/pw_exec.py Show resolved Hide resolved
tools/pw_exec.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
tools/trusted_2_6.py Show resolved Hide resolved
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Mar 17, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.24%.

Quality metrics Before After Change
Complexity 18.24 🙂 17.82 🙂 -0.42 👍
Method Length 97.05 🙂 97.02 🙂 -0.03 👍
Working memory 12.24 😞 12.26 😞 0.02 👎
Quality 48.27% 😞 48.51% 😞 0.24% 👍
Other metrics Before After Change
Lines 3930 3904 -26
Changed files Quality Before Quality After Quality Change
tools/power.py 43.41% 😞 43.62% 😞 0.21% 👍
tools/pw_exec.py 59.72% 🙂 59.90% 🙂 0.18% 👍
tools/trusted_2_6.py 56.04% 🙂 56.75% 🙂 0.71% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
tools/power.py main 81 ⛔ 892 ⛔ 23 ⛔ 3.13% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tools/power.py powershell_obfuscation 74 ⛔ 704 ⛔ 17 ⛔ 7.26% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tools/power.py Listener.psh_Local_Spawn_Shell 27 😞 550 ⛔ 19 ⛔ 16.10% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tools/power.py Listener.psh_Local_Invoke 25 😞 307 ⛔ 17 ⛔ 21.83% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tools/power.py generate_source 14 🙂 528 ⛔ 26 ⛔ 22.12% ⛔ Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@Advik-B Advik-B merged commit 7b95434 into master Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants