Skip to content

Sourcery refactored master branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
masterfrom
sourcery/master
Open

Sourcery refactored master branch#1
sourcery-ai[bot] wants to merge 1 commit into
masterfrom
sourcery/master

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented Nov 22, 2020

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^

def remover_acentos(txt):
txt = normalize('NFKD', txt).encode('ASCII', 'ignore').decode('ASCII')
return txt
return normalize('NFKD', txt).encode('ASCII', 'ignore').decode('ASCII')

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 remover_acentos refactored with the following changes:

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

Comment on lines -21 to +25
resultado = 'Negativo'
return 'Negativo'
elif text > 0.7:
resultado = 'Positivo'
return 'Positivo'
else:
resultado = 'Neutro'
return resultado
return 'Neutro'

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 calcular_sentimento refactored with the following changes:

  • Lift return into if (lift-return-into-if)

@sourcery-ai

sourcery-ai Bot commented Nov 22, 2020

Copy link
Copy Markdown
Author

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.59 ⭐ 0.56 ⭐ -0.03 👍
Method Length 59.71 ⭐ 58.57 ⭐ -1.14 👍
Working memory 5.04 ⭐ 4.91 ⭐ -0.13 👍
Quality 79.65% 79.64% -0.01% 👎
Other metrics Before After Change
Lines 87 85 -2
Changed files Quality Before Quality After Quality Change
Bolsonaro 2019/2 - Analises Dados/Posts Mais Influentes/Analise de Sentimentos/1000comentarios.py 89.55% ⭐ 89.70% ⭐ 0.15% 👍
Bolsonaro 2019/2 - Analises Dados/Posts Mais Influentes/Analise de Sentimentos/analisesentimentos.py 75.33% ⭐ 75.41% ⭐ 0.08% 👍

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

File Function Complexity Length Working Memory Quality Recommendation

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.

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