Skip to content

Sourcery refactored master branch #1

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

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 Jun 25, 2022

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 GreyElaina June 25, 2022 08:55
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Due to GitHub API limits, only the first 60 comments can be shown.

return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py)[1]
Copy link
Author

Choose a reason for hiding this comment

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

Function get_version refactored with the following changes:

Comment on lines +5 to +10

from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.shortcuts import checkboxlist_dialog, message_dialog
from prompt_toolkit.styles import Style

results = checkboxlist_dialog(
if results := checkboxlist_dialog(
Copy link
Author

Choose a reason for hiding this comment

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

Lines 9-30 refactored with the following changes:

output = "\n\nIn: {}\nOut: {}".format(
input_field.text, eval(input_field.text)
) # Don't do 'eval' in real code!
output = f"\n\nIn: {input_field.text}\nOut: {eval(input_field.text)}"
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.accept refactored with the following changes:

This removes the following comments ( why? ):

# Don't do 'eval' in real code!

Comment on lines -28 to +31
("class:status", _pager_py_path + " - "),
("class:status", f"{_pager_py_path} - "),
(
"class:status.position",
"{}:{}".format(
text_area.document.cursor_position_row + 1,
text_area.document.cursor_position_col + 1,
),
f"{text_area.document.cursor_position_row + 1}:{text_area.document.cursor_position_col + 1}",
Copy link
Author

Choose a reason for hiding this comment

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

Function get_statusbar_text refactored with the following changes:

return " {}:{} ".format(
text_field.document.cursor_position_row + 1,
text_field.document.cursor_position_col + 1,
)
return f" {text_field.document.cursor_position_row + 1}:{text_field.document.cursor_position_col + 1} "
Copy link
Author

Choose a reason for hiding this comment

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

Function get_statusbar_right_text refactored with the following changes:

Comment on lines -40 to +45
title="Progress bar example with custom formatter.",
formatters=custom_formatters,
style=style,
) as pb:
title="Progress bar example with custom formatter.",
formatters=custom_formatters,
style=style,
) as pb:

for i in pb(range(20), label="Downloading..."):
for _ in pb(range(20), label="Downloading..."):
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:

for i in pb(range(1600), label="Installing"):
for _ in pb(range(1600), label="Installing"):
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:

Comment on lines -24 to +26
if true_color:
color_depth = ColorDepth.DEPTH_24_BIT
else:
color_depth = ColorDepth.DEPTH_8_BIT

color_depth = ColorDepth.DEPTH_24_BIT if true_color else ColorDepth.DEPTH_8_BIT
with ProgressBar(formatters=custom_formatters, color_depth=color_depth) as pb:
for i in pb(range(20), label="Downloading..."):
for _ in pb(range(20), label="Downloading..."):
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:

for i in pb(range(1600), label="Installing"):
for _ in pb(range(1600), label="Installing"):
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:

for i in pb(range(1600), label="Installing"):
for _ in pb(range(1600), label="Installing"):
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:

for i in pb(range(100)):
for _ in pb(range(100)):
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.task_1 refactored with the following changes:

for i in pb(range(150)):
for _ in pb(range(150)):
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.task_2 refactored with the following changes:

for i in pb(data()):
for _ in pb(data()):
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:

@@ -6,11 +6,12 @@
This should display the prompt with all the formatting like usual, but not
allow any editing.
"""

Copy link
Author

Choose a reason for hiding this comment

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

Lines 16-16 refactored with the following changes:

print("You said: %s" % text)
print(f"You said: {text}")
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:

print("You said: %s" % answer)
print(f"You said: {answer}")
Copy link
Author

Choose a reason for hiding this comment

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

Lines 7-7 refactored with the following changes:

Comment on lines +6 to +13

import getpass

from prompt_toolkit import prompt

if __name__ == "__main__":
answer = prompt("What is your name: ", default="%s" % getpass.getuser())
print("You said: %s" % answer)
answer = prompt("What is your name: ", default=f"{getpass.getuser()}")
print(f"You said: {answer}")
Copy link
Author

Choose a reason for hiding this comment

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

Lines 11-12 refactored with the following changes:

Comment on lines +5 to +10

from prompt_toolkit import prompt

if __name__ == "__main__":
answer = prompt("Give me some input: ")
print("You said: %s" % answer)
print(f"You said: {answer}")
Copy link
Author

Choose a reason for hiding this comment

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

Lines 9-9 refactored with the following changes:

Comment on lines -19 to +20
else:
text = ("- %i - " % (line_number + 1)).rjust(width)
return HTML("<strong>%s</strong>") % text
text = ("- %i - " % (line_number + 1)).rjust(width)
return HTML("<strong>%s</strong>") % text
Copy link
Author

Choose a reason for hiding this comment

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

Function prompt_continuation refactored with the following changes:

Comment on lines -29 to +28
print("You said: %s" % answer)
print(f"You said: {answer}")
Copy link
Author

Choose a reason for hiding this comment

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

Lines 29-29 refactored with the following changes:

print("You said: %s" % password)
print(f"You said: {password}")
Copy link
Author

Choose a reason for hiding this comment

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

Lines 6-6 refactored with the following changes:

print("You said: %s" % text)
print(f"You said: {text}")
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:

Comment on lines -25 to +31
print("You said: %s" % text)
print(f"You said: {text}")

# While typing
text = prompt(
"Enter e-mail address: ", validator=validator, validate_while_typing=True
)
print("You said: %s" % text)
print(f"You said: {text}")
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:

print("You said: %s" % result)
print(f"You said: {result}")
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:

print("You said: %s" % answer)
print(f"You said: {answer}")
Copy link
Author

Choose a reason for hiding this comment

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

Lines 10-10 refactored with the following changes:

print("You said: %s" % text)
print(f"You said: {text}")
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:

print("You said: %s" % text)
print(f"You said: {text}")
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:

print("You said: %s" % text)
print(f"You said: {text}")
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:

Comment on lines -31 to +32
style="fg:" + color,
selected_style="fg:white bg:" + color,
style=f"fg:{color}",
selected_style=f"fg:white bg:{color}",
Copy link
Author

Choose a reason for hiding this comment

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

Function ColorCompleter.get_completions refactored with the following changes:

print("You said: %s" % text)
print(f"You said: {text}")
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:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Jun 25, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 20.02 😞 19.40 😞 -0.62 👍
Method Length 43.46 ⭐ 43.33 ⭐ -0.13 👍
Working memory 8.50 🙂 8.53 🙂 0.03 👎
Quality 67.53% 🙂 67.74% 🙂 0.21% 👍
Other metrics Before After Change
Lines 37567 37068 -499
Changed files Quality Before Quality After Quality Change
setup.py 90.18% ⭐ 90.28% ⭐ 0.10% 👍
examples/dialogs/checkbox_dialog.py 70.45% 🙂 63.99% 🙂 -6.46% 👎
examples/full-screen/calculator.py 75.58% ⭐ 75.38% ⭐ -0.20% 👎
examples/full-screen/pager.py 91.40% ⭐ 90.73% ⭐ -0.67% 👎
examples/full-screen/text-editor.py 86.81% ⭐ 86.66% ⭐ -0.15% 👎
examples/full-screen/simple-demos/line-prefixes.py 87.67% ⭐ 87.64% ⭐ -0.03% 👎
examples/print-text/named-colors.py 91.23% ⭐ 90.99% ⭐ -0.24% 👎
examples/print-text/true-color-demo.py 88.12% ⭐ 88.71% ⭐ 0.59% 👍
examples/progress-bar/a-lot-of-parallel-tasks.py 66.30% 🙂 66.51% 🙂 0.21% 👍
examples/progress-bar/colored-title-and-label.py 94.02% ⭐ 94.02% ⭐ 0.00%
examples/progress-bar/many-parallel-tasks.py 76.95% ⭐ 77.41% ⭐ 0.46% 👍
examples/progress-bar/nested-progress-bars.py 85.85% ⭐ 87.62% ⭐ 1.77% 👍
examples/progress-bar/scrolling-task-name.py 97.45% ⭐ 97.45% ⭐ 0.00%
examples/progress-bar/simple-progress-bar.py 97.89% ⭐ 97.89% ⭐ 0.00%
examples/progress-bar/styled-1.py 95.53% ⭐ 95.53% ⭐ 0.00%
examples/progress-bar/styled-2.py 89.50% ⭐ 89.50% ⭐ 0.00%
examples/progress-bar/styled-apt-get-install.py 90.04% ⭐ 90.04% ⭐ 0.00%
examples/progress-bar/styled-rainbow.py 85.47% ⭐ 85.16% ⭐ -0.31% 👎
examples/progress-bar/styled-tqdm-1.py 86.14% ⭐ 86.14% ⭐ 0.00%
examples/progress-bar/styled-tqdm-2.py 88.46% ⭐ 88.46% ⭐ 0.00%
examples/progress-bar/two-tasks.py 83.47% ⭐ 83.47% ⭐ 0.00%
examples/progress-bar/unknown-length.py 98.50% ⭐ 98.50% ⭐ 0.00%
examples/prompts/accept-default.py 91.05% ⭐ 90.89% ⭐ -0.16% 👎
examples/prompts/auto-suggestion.py 82.00% ⭐ 81.87% ⭐ -0.13% 👎
examples/prompts/autocorrection.py 82.30% ⭐ 83.85% ⭐ 1.55% 👍
examples/prompts/clock-input.py 96.21% ⭐ 96.15% ⭐ -0.06% 👎
examples/prompts/colored-prompt.py 96.71% ⭐ 96.60% ⭐ -0.11% 👎
examples/prompts/confirmation-prompt.py 97.50% ⭐ 97.34% ⭐ -0.16% 👎
examples/prompts/custom-key-binding.py 87.36% ⭐ 87.36% ⭐ 0.00%
examples/prompts/custom-lexer.py 90.97% ⭐ 90.93% ⭐ -0.04% 👎
examples/prompts/fancy-zsh-prompt.py 86.67% ⭐ 86.63% ⭐ -0.04% 👎
examples/prompts/finalterm-shell-integration.py 89.89% ⭐ 89.80% ⭐ -0.09% 👎
examples/prompts/get-input-vi-mode.py 93.68% ⭐ 93.51% ⭐ -0.17% 👎
examples/prompts/get-input-with-default.py 90.89% ⭐ 93.35% ⭐ 2.46% 👍
examples/prompts/get-input.py 97.50% ⭐ 97.34% ⭐ -0.16% 👎
examples/prompts/get-multiline-input.py 86.89% ⭐ 88.67% ⭐ 1.78% 👍
examples/prompts/get-password.py 97.34% ⭐ 97.17% ⭐ -0.17% 👎
examples/prompts/html-input.py 98.80% ⭐ 98.70% ⭐ -0.10% 👎
examples/prompts/input-validation.py 96.02% ⭐ 95.85% ⭐ -0.17% 👎
examples/prompts/inputhook.py 94.65% ⭐ 94.61% ⭐ -0.04% 👎
examples/prompts/mouse-support.py 95.68% ⭐ 95.51% ⭐ -0.17% 👎
examples/prompts/multiline-prompt.py 97.17% ⭐ 97.00% ⭐ -0.17% 👎
examples/prompts/no-wrapping.py 94.34% ⭐ 94.18% ⭐ -0.16% 👎
examples/prompts/placeholder-text.py 96.50% ⭐ 96.34% ⭐ -0.16% 👎
examples/prompts/regular-language.py 46.90% 😞 47.28% 😞 0.38% 👍
examples/prompts/rprompt.py 92.02% ⭐ 91.63% ⭐ -0.39% 👎
examples/prompts/swap-light-and-dark-colors.py 82.40% ⭐ 82.89% ⭐ 0.49% 👍
examples/prompts/system-clipboard-integration.py 93.39% ⭐ 93.23% ⭐ -0.16% 👎
examples/prompts/system-prompt.py 91.15% ⭐ 90.68% ⭐ -0.47% 👎
examples/prompts/terminal-title.py 96.01% ⭐ 95.84% ⭐ -0.17% 👎
examples/prompts/up-arrow-partial-string-matching.py 84.77% ⭐ 84.64% ⭐ -0.13% 👎
examples/prompts/auto-completion/autocomplete-with-control-space.py 93.34% ⭐ 93.30% ⭐ -0.04% 👎
examples/prompts/auto-completion/autocompletion-like-readline.py 95.28% ⭐ 95.20% ⭐ -0.08% 👎
examples/prompts/auto-completion/autocompletion.py 96.71% ⭐ 96.62% ⭐ -0.09% 👎
examples/prompts/auto-completion/colored-completions.py 85.10% ⭐ 84.99% ⭐ -0.11% 👎
examples/prompts/auto-completion/combine-multiple-completers.py 94.86% ⭐ 94.78% ⭐ -0.08% 👎
examples/prompts/auto-completion/fuzzy-custom-completer.py 89.91% ⭐ 89.78% ⭐ -0.13% 👎
examples/prompts/auto-completion/fuzzy-word-completer.py 96.76% ⭐ 96.68% ⭐ -0.08% 👎
examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py 94.48% ⭐ 94.40% ⭐ -0.08% 👎
examples/prompts/auto-completion/multi-column-autocompletion.py 95.28% ⭐ 95.20% ⭐ -0.08% 👎
examples/prompts/auto-completion/nested-autocompletion.py 97.00% ⭐ 96.92% ⭐ -0.08% 👎
examples/prompts/history/persistent-history.py 94.76% ⭐ 94.64% ⭐ -0.12% 👎
examples/prompts/history/slow-history.py 95.67% ⭐ 95.59% ⭐ -0.08% 👎
examples/ssh/asyncssh-server.py 82.95% ⭐ 82.95% ⭐ 0.00%
examples/telnet/chat-app.py 78.89% ⭐ 78.53% ⭐ -0.36% 👎
examples/tutorial/sqlite-cli.py 76.88% ⭐ 75.56% ⭐ -1.32% 👎
src/prompt_toolkit/auto_suggest.py 92.34% ⭐ 92.21% ⭐ -0.13% 👎
src/prompt_toolkit/buffer.py 68.81% 🙂 69.12% 🙂 0.31% 👍
src/prompt_toolkit/document.py 70.83% 🙂 71.61% 🙂 0.78% 👍
src/prompt_toolkit/history.py 84.21% ⭐ 84.15% ⭐ -0.06% 👎
src/prompt_toolkit/patch_stdout.py 86.34% ⭐ 86.67% ⭐ 0.33% 👍
src/prompt_toolkit/renderer.py 53.03% 🙂 53.09% 🙂 0.06% 👍
src/prompt_toolkit/search.py 81.44% ⭐ 81.11% ⭐ -0.33% 👎
src/prompt_toolkit/utils.py 81.02% ⭐ 80.21% ⭐ -0.81% 👎
src/prompt_toolkit/validation.py 94.98% ⭐ 95.30% ⭐ 0.32% 👍
src/prompt_toolkit/application/application.py 65.24% 🙂 65.31% 🙂 0.07% 👍
src/prompt_toolkit/application/run_in_terminal.py 80.49% ⭐ 79.32% ⭐ -1.17% 👎
src/prompt_toolkit/clipboard/in_memory.py 94.48% ⭐ 93.95% ⭐ -0.53% 👎
src/prompt_toolkit/completion/base.py 90.07% ⭐ 90.97% ⭐ 0.90% 👍
src/prompt_toolkit/completion/filesystem.py 53.19% 🙂 57.96% 🙂 4.77% 👍
src/prompt_toolkit/completion/fuzzy_completer.py 74.79% 🙂 75.09% ⭐ 0.30% 👍
src/prompt_toolkit/contrib/regular_languages/compiler.py 53.56% 🙂 52.87% 🙂 -0.69% 👎
src/prompt_toolkit/contrib/regular_languages/completion.py 79.02% ⭐ 78.27% ⭐ -0.75% 👎
src/prompt_toolkit/contrib/regular_languages/lexer.py 55.12% 🙂 60.91% 🙂 5.79% 👍
src/prompt_toolkit/contrib/regular_languages/regex_parser.py 53.07% 🙂 52.82% 🙂 -0.25% 👎
src/prompt_toolkit/contrib/regular_languages/validation.py 71.80% 🙂 75.77% ⭐ 3.97% 👍
src/prompt_toolkit/contrib/ssh/server.py 86.22% ⭐ 86.62% ⭐ 0.40% 👍
src/prompt_toolkit/contrib/telnet/protocol.py 74.77% 🙂 74.79% 🙂 0.02% 👍
src/prompt_toolkit/contrib/telnet/server.py 81.82% ⭐ 81.48% ⭐ -0.34% 👎
src/prompt_toolkit/eventloop/async_context_manager.py 77.51% ⭐ 78.74% ⭐ 1.23% 👍
src/prompt_toolkit/eventloop/inputhook.py 85.59% ⭐ 85.45% ⭐ -0.14% 👎
src/prompt_toolkit/eventloop/utils.py 85.21% ⭐ 84.49% ⭐ -0.72% 👎
src/prompt_toolkit/eventloop/win32.py 89.87% ⭐ 91.29% ⭐ 1.42% 👍
src/prompt_toolkit/filters/app.py 86.20% ⭐ 87.83% ⭐ 1.63% 👍
src/prompt_toolkit/formatted_text/ansi.py 44.97% 😞 45.53% 😞 0.56% 👍
src/prompt_toolkit/formatted_text/base.py 84.08% ⭐ 84.92% ⭐ 0.84% 👍
src/prompt_toolkit/formatted_text/html.py 47.79% 😞 49.89% 😞 2.10% 👍
src/prompt_toolkit/formatted_text/pygments.py 94.55% ⭐ 96.11% ⭐ 1.56% 👍
src/prompt_toolkit/input/ansi_escape_sequences.py 82.50% ⭐ 83.50% ⭐ 1.00% 👍
src/prompt_toolkit/input/base.py 99.87% ⭐ 99.86% ⭐ -0.01% 👎
src/prompt_toolkit/input/posix_pipe.py 95.43% ⭐ 95.43% ⭐ 0.00%
src/prompt_toolkit/input/vt100.py 84.73% ⭐ 84.75% ⭐ 0.02% 👍
src/prompt_toolkit/input/vt100_parser.py 68.10% 🙂 67.32% 🙂 -0.78% 👎
src/prompt_toolkit/input/win32.py 70.28% 🙂 71.34% 🙂 1.06% 👍
src/prompt_toolkit/key_binding/key_bindings.py 75.28% ⭐ 77.10% ⭐ 1.82% 👍
src/prompt_toolkit/key_binding/key_processor.py 71.05% 🙂 71.31% 🙂 0.26% 👍
src/prompt_toolkit/key_binding/bindings/auto_suggest.py 80.16% ⭐ 79.48% ⭐ -0.68% 👎
src/prompt_toolkit/key_binding/bindings/emacs.py 61.40% 🙂 61.64% 🙂 0.24% 👍
src/prompt_toolkit/key_binding/bindings/named_commands.py 89.38% ⭐ 88.92% ⭐ -0.46% 👎
src/prompt_toolkit/key_binding/bindings/scroll.py 68.43% 🙂 69.82% 🙂 1.39% 👍
src/prompt_toolkit/key_binding/bindings/vi.py 49.86% 😞 49.93% 😞 0.07% 👍
src/prompt_toolkit/layout/containers.py 55.21% 🙂 55.11% 🙂 -0.10% 👎
src/prompt_toolkit/layout/controls.py 70.04% 🙂 70.31% 🙂 0.27% 👍
src/prompt_toolkit/layout/dimension.py 76.23% ⭐ 75.86% ⭐ -0.37% 👎
src/prompt_toolkit/layout/layout.py 77.60% ⭐ 79.38% ⭐ 1.78% 👍
src/prompt_toolkit/layout/margins.py 63.60% 🙂 62.98% 🙂 -0.62% 👎
src/prompt_toolkit/layout/menus.py 64.98% 🙂 65.02% 🙂 0.04% 👍
src/prompt_toolkit/layout/processors.py 69.62% 🙂 70.27% 🙂 0.65% 👍
src/prompt_toolkit/layout/screen.py 82.38% ⭐ 82.21% ⭐ -0.17% 👎
src/prompt_toolkit/layout/scrollable_pane.py 55.03% 🙂 55.17% 🙂 0.14% 👍
src/prompt_toolkit/layout/utils.py 90.64% ⭐ 91.28% ⭐ 0.64% 👍
src/prompt_toolkit/lexers/pygments.py 65.78% 🙂 66.62% 🙂 0.84% 👍
src/prompt_toolkit/output/conemu.py 94.84% ⭐ 94.84% ⭐ 0.00%
src/prompt_toolkit/output/flush_stdout.py 80.84% ⭐ 81.51% ⭐ 0.67% 👍
src/prompt_toolkit/output/vt100.py 71.30% 🙂 73.24% 🙂 1.94% 👍
src/prompt_toolkit/output/win32.py 82.23% ⭐ 82.24% ⭐ 0.01% 👍
src/prompt_toolkit/output/windows10.py 90.82% ⭐ 90.82% ⭐ 0.00%
src/prompt_toolkit/shortcuts/dialogs.py 77.05% ⭐ 77.19% ⭐ 0.14% 👍
src/prompt_toolkit/shortcuts/prompt.py 48.67% 😞 48.52% 😞 -0.15% 👎
src/prompt_toolkit/shortcuts/utils.py 65.70% 🙂 65.47% 🙂 -0.23% 👎
src/prompt_toolkit/shortcuts/progress_bar/base.py 80.46% ⭐ 80.75% ⭐ 0.29% 👍
src/prompt_toolkit/shortcuts/progress_bar/formatters.py 83.23% ⭐ 83.19% ⭐ -0.04% 👎
src/prompt_toolkit/styles/defaults.py 77.24% ⭐ 77.23% ⭐ -0.01% 👎
src/prompt_toolkit/styles/pygments.py 94.83% ⭐ 95.33% ⭐ 0.50% 👍
src/prompt_toolkit/styles/style.py 61.12% 🙂 61.21% 🙂 0.09% 👍
src/prompt_toolkit/styles/style_transformation.py 83.31% ⭐ 83.32% ⭐ 0.01% 👍
src/prompt_toolkit/widgets/base.py 67.97% 🙂 68.63% 🙂 0.66% 👍
src/prompt_toolkit/widgets/menus.py 42.17% 😞 41.38% 😞 -0.79% 👎
src/prompt_toolkit/widgets/toolbars.py 69.91% 🙂 69.65% 🙂 -0.26% 👎
tests/test_buffer.py 95.60% ⭐ 95.55% ⭐ -0.05% 👎
tests/test_completion.py 74.07% 🙂 74.12% 🙂 0.05% 👍
tests/test_regular_languages.py 82.46% ⭐ 81.92% ⭐ -0.54% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
src/prompt_toolkit/layout/containers.py Window._copy_body 96 ⛔ 599 ⛔ 20 ⛔ 4.51% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/prompt_toolkit/shortcuts/prompt.py PromptSession.prompt 40 ⛔ 447 ⛔ 48 ⛔ 6.43% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/prompt_toolkit/shortcuts/prompt.py PromptSession.prompt_async 40 ⛔ 442 ⛔ 47 ⛔ 6.48% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/prompt_toolkit/layout/containers.py FloatContainer._draw_float 48 ⛔ 488 ⛔ 21 ⛔ 7.64% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/prompt_toolkit/renderer.py _output_screen_diff 42 ⛔ 514 ⛔ 23 ⛔ 8.00% ⛔ Refactor to reduce nesting. 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.

0 participants