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 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 9, 2020

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^

@scribe-connect
Copy link

scribe-connect bot commented Aug 9, 2020

Linked documents: 0
Files with no linked documents: 13
Recently updated documents: 0
Out of date documents: 0
Very out of date documents: 0

Comment on lines -7 to +8
lbl = gui.Label("Hello world!", width=100, height=30)

# return of the root widget
return lbl
return gui.Label("Hello world!", width=100, height=30)
Copy link
Author

Choose a reason for hiding this comment

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

Function MyApp.main refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

Comment on lines -57 to +58
for ri in range(0, table.row_count()):
for ci in range(0, table.column_count()):
for ri in range(table.row_count()):
for ci in range(table.column_count()):
Copy link
Author

Choose a reason for hiding this comment

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

Function MyApp.fill_table refactored with the following changes:

  • Replace range(0, x) with range(x) (remove-zero-from-range)

if not 'editing_mode' in kwargs.keys():
if 'editing_mode' not in kwargs.keys():
Copy link
Author

Choose a reason for hiding this comment

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

Function untitled.__init__ refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

@@ -43,7 +43,6 @@ def construct_ui(self):

def onclick_button(self, emitter):
self.mainContainer.children['label'].set_text('hello world')
pass
Copy link
Author

Choose a reason for hiding this comment

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

Function untitled.onclick_button refactored with the following changes:

  • Remove redundant pass statement (remove-redundant-pass)

if not 'editing_mode' in kwargs.keys():
if 'editing_mode' not in kwargs.keys():
Copy link
Author

Choose a reason for hiding this comment

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

Function untitled.__init__ refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

Comment on lines -28 to -32
model_cfg = {
return {
'output_stride': output_stride,
'checkpoint_name': checkpoint_name,
}
return model_cfg
Copy link
Author

Choose a reason for hiding this comment

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

Function load_config refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

out_img = cv2.drawKeypoints(img, cv_keypoints, outImage=np.array([]))
return out_img
return cv2.drawKeypoints(img, cv_keypoints, outImage=np.array([]))
Copy link
Author

Choose a reason for hiding this comment

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

Function draw_keypoints refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

cfg = yaml.load(cfg_f)
return cfg
return yaml.load(cfg_f)
Copy link
Author

Choose a reason for hiding this comment

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

Function load_config refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)


Copy link
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:

  • Replace assignment with augmented assignment (aug-assign)
  • Replace range(0, x) with range(x) (remove-zero-from-range)

self.lbl.set_text(cvs.getLbs())
pass
self.lbl.set_text(cvs.getLbs())
Copy link
Author

Choose a reason for hiding this comment

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

Function MyApp.idle refactored with the following changes:

  • Remove redundant pass statement (remove-redundant-pass)

@pep8speaks
Copy link

pep8speaks commented Aug 9, 2020

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

Line 54:17: E303 too many blank lines (2)
Line 137:40: W291 trailing whitespace

Comment last updated at 2020-08-09 14:45:33 UTC

@pull-assistant
Copy link

pull-assistant bot commented Aug 9, 2020

Score: 1.00

Best reviewed: commit by commit


Optimal code review plan

     'Refactored by Sourcery'

Powered by Pull Assistant. Last update 9b5af2f ... 9b5af2f. Read the comment docs.

@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Aug 9, 2020
@sourcery-ai sourcery-ai bot force-pushed the sourcery/master branch from 24ee78a to 9b5af2f Compare August 9, 2020 14:45
@commit-lint
Copy link

commit-lint bot commented Aug 9, 2020

generate by www.commit-lint.com

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Aug 9, 2020

Sourcery Code Quality Report (beta)

✅  Merging this PR will increase code quality in the affected files by 0.01 out of 10.

Quality metrics Before After Change
Complexity 1.79 1.74 -0.05 🔵
Method Length 55.68 55.32 -0.36 🔵
Quality 8.71 8.72 0.01 🔵
Other metrics Before After Change
Lines 997 985 -12
Changed files Quality Before Quality After Quality Change
gui_cvs/hello.py 9.73 9.75 0.02 🔵
gui_cvs/table.py 9.17 9.17 0.00
gui_wizard/helloworld.py 9.19 9.20 0.01 🔵
src/cvs/webcam.py 9.47 9.48 0.01 🔵
src/facencnn/facepose.py 8.58 8.59 0.01 🔵
src/handtf/webcam.py 8.60 8.60 0.00
src/handtf/utils/detector_utils.py 8.07 8.08 0.01 🔵
src/mutilpose/webcam_demo.py 8.58 8.58 0.00
src/mutilpose/posenet/decode_multi.py 7.95 7.99 0.04 🔵
src/mutilpose/posenet/model.py 8.46 8.48 0.02 🔵
src/mutilpose/posenet/utils.py 8.30 8.30 0.00
src/mutilpose/posenet/converter/config.py 9.55 9.59 0.04 🔵
src/singlepose/webpose.py 8.52 8.52 0.00

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

File Function Complexity Length Overall Recommendation
src/singlepose/webpose.py main 17 612.50 3.38 Split out functionality
src/facencnn/facepose.py main 13 260.53 4.42 Split out functionality
src/handtf/utils/detector_utils.py draw_box_on_image 12 252.58 4.56 Split out functionality
src/mutilpose/posenet/decode_multi.py decode_multiple_poses 8 232.73 5.10 Split out functionality
src/handtf/webcam.py main 10 189.74 5.32 Split out functionality

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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 Ready for Review Pull Request is not reviewed yet size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant