Skip to content

Deleting unecessary API (Sourcery refactored)#135

Closed
sourcery-ai[bot] wants to merge 1 commit into
fix/dss-90-jupyter-api-rmfrom
sourcery/fix/dss-90-jupyter-api-rm
Closed

Deleting unecessary API (Sourcery refactored)#135
sourcery-ai[bot] wants to merge 1 commit into
fix/dss-90-jupyter-api-rmfrom
sourcery/fix/dss-90-jupyter-api-rm

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented Mar 30, 2021

Copy link
Copy Markdown

Pull Request #134 refactored by Sourcery.

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

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

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 fix/dss-90-jupyter-api-rm branch, then run:

git fetch origin sourcery/fix/dss-90-jupyter-api-rm
git merge --ff-only FETCH_HEAD
git reset HEAD^

@sourcery-ai sourcery-ai Bot requested a review from pbailly March 30, 2021 09:14
@sourcery-ai sourcery-ai Bot force-pushed the sourcery/fix/dss-90-jupyter-api-rm branch from 5329ddd to 22447a3 Compare March 30, 2021 21:22
Comment thread dataikuapi/dssclient.py
Comment on lines -570 to +575
definition = {}
definition['name'] = cluster_name
definition['type'] = cluster_type
definition['params'] = params if params is not None else {}
definition = {
'name': cluster_name,
'type': cluster_type,
'params': params if params is not None else {},
}

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 DSSClient.create_cluster refactored with the following changes:

Comment thread dataikuapi/dssclient.py
Comment on lines -684 to +686
if isinstance(v, str) or isinstance(v, unicode):
if isinstance(v, (str, unicode)):

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 DSSClient.make_entry refactored with the following changes:

@sourcery-ai

sourcery-ai Bot commented Mar 30, 2021

Copy link
Copy Markdown
Author

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.53 ⭐ 1.44 ⭐ -0.09 👍
Method Length 26.18 ⭐ 25.95 ⭐ -0.23 👍
Working memory 7.94 🙂 7.90 🙂 -0.04 👍
Quality 81.65% 81.99% 0.34% 👍
Other metrics Before After Change
Lines 927 929 2
Changed files Quality Before Quality After Quality Change
dataikuapi/dssclient.py 81.65% ⭐ 81.99% ⭐ 0.34% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
dataikuapi/dssclient.py DSSClient.create_meaning 5 ⭐ 116 🙂 14 😞 55.31% 🙂 Extract out complex expressions
dataikuapi/dssclient.py DSSClient.sql_query 1 ⭐ 60 ⭐ 20 ⛔ 61.62% 🙂 Extract out complex expressions
dataikuapi/dssclient.py DSSClient._perform_http 5 ⭐ 94 🙂 11 😞 62.98% 🙂 Extract out complex expressions
dataikuapi/dssclient.py DSSClient.create_code_env 3 ⭐ 78 🙂 13 😞 63.96% 🙂 Extract out complex expressions
dataikuapi/dssclient.py DSSClient.create_global_api_key 3 ⭐ 86 🙂 11 😞 66.09% 🙂 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!

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

@sourcery-ai sourcery-ai Bot closed this Mar 30, 2021
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