Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Sourcery refactored master branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
masterrahulgurujala/cpp2python:masterfrom
sourcery/masterrahulgurujala/cpp2python:sourcery/masterCopy head branch name to clipboard
Open

Sourcery refactored master branch#1
sourcery-ai[bot] wants to merge 1 commit into
masterrahulgurujala/cpp2python:masterfrom
sourcery/masterrahulgurujala/cpp2python:sourcery/masterCopy head branch name to clipboard

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented Feb 13, 2022

Copy link
Copy Markdown

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 rahulgurujala February 13, 2022 17:52
Comment thread cpp2python.py
if filename.endswith(s):
return True
return False
return any(filename.endswith(s) for s in suffixes)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function is_source refactored with the following changes:

  • Use any() instead of for loop (use-any)

Comment thread cpp2python.py
Comment on lines -309 to +311
in_filename = root + '/' + file
in_filename = f'{root}/{file}'
if is_source(in_filename):
out_filename = in_filename + '.py' # not ideal
out_filename = f'{in_filename}.py'
process_file(in_filename, out_filename)
elif os.path.isfile(sys.argv[1]):
process_file(sys.argv[1], sys.argv[1] + '.py')
process_file(sys.argv[1], f'{sys.argv[1]}.py')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function main refactored with the following changes:

This removes the following comments ( why? ):

# not ideal

@sourcery-ai

sourcery-ai Bot commented Feb 13, 2022

Copy link
Copy Markdown
Author

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.84%.

Quality metrics Before After Change
Complexity 3.22 ⭐ 3.12 ⭐ -0.10 👍
Method Length 87.00 🙂 86.66 🙂 -0.34 👍
Working memory 5.14 ⭐ 5.25 ⭐ 0.11 👎
Quality 67.90% 🙂 67.06% 🙂 -0.84% 👎
Other metrics Before After Change
Lines 312 309 -3
Changed files Quality Before Quality After Quality Change
cpp2python.py 67.90% 🙂 67.06% 🙂 -0.84% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
cpp2python.py main 15 🙂 134.97 😞 7 🙂 57.14% 🙂 Try splitting into smaller methods
cpp2python.py process_line 0 ⭐ 301 ⛔ 5 ⭐ 64.82% 🙂 Try splitting into smaller methods

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!

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.

0 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.