Skip to content

Conversation

@SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

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

git fetch https://github.com/sourcery-ai-bot/Power-BI-REST-API-Postman-Collection master
git merge --ff-only FETCH_HEAD
git reset HEAD^


uri_parameters_table = soup.select_one('#uri-parameters + table')
if uri_parameters_table:
if uri_parameters_table := soup.select_one('#uri-parameters + table'):
Copy link
Author

Choose a reason for hiding this comment

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

Function parse_page refactored with the following changes:

This removes the following comments ( why? ):

# query

Comment on lines -175 to +194
operations.append({
'name': name,
"request": {
"method": method,
"header": headers,
"body": body,
"url": {
"raw": url,
"protocol": parsed_url.scheme, # "https",
"host": parsed_url.netloc.split('.'), # ["api", "powerbi", "com"],
"path": paths, # ["v1.0", "myorg", "groups"],
"query": query
operations.append(
{
'name': name,
"request": {
"method": method,
"header": headers,
"body": body,
"url": {
"raw": url,
"protocol": parsed_url.scheme, # "https",
"host": parsed_url.netloc.split(
'.'
), # ["api", "powerbi", "com"],
"path": paths, # ["v1.0", "myorg", "groups"],
"query": query,
},
"description": f'{description_title}<br>{description_html}',
},
"description": description_title + '<br>' + description_html
},
"response": [],
'_link': full_href
})
"response": [],
'_link': full_href,
}
)

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:

@commit-lint
Copy link

commit-lint bot commented Nov 27, 2022

Contributors

sourcery-ai-bot

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

sourcery-ai bot commented Nov 27, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 22.33 😞 18.15 🙂 -4.18 👍
Method Length 219.00 ⛔ 216.75 ⛔ -2.25 👍
Working memory 22.33 ⛔ 21.62 ⛔ -0.71 👍
Quality 22.42% 24.72% 2.30% 👍
Other metrics Before After Change
Lines 196 198 2
Changed files Quality Before Quality After Quality Change
parser.py 22.42% ⛔ 24.72% ⛔ 2.30% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
parser.py parse_page 29 😞 384 ⛔ 26 ⛔ 13.14% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
parser.py main 7 ⭐ 440 ⛔ 18 ⛔ 32.87% 😞 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!

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.

1 participant