Repository Analysis

Textualize/rich

Rich is a Python library for rich text and beautiful formatting in the terminal.

12.2 Low AI signal View on GitHub
12.2
Adjusted Score
12.2
Raw Score
100%
Time Factor
2026-04-12
Last Push
56,499
Stars
Python
Language
68,106
Lines of Code
454
Files
496
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 75MEDIUM 6LOW 415

Pattern Findings

496 matches across 10 categories. Click a row to expand file-level details.

Cross-File Repetition48 hits · 240 pts
SeverityFileLineSnippet
HIGHREADME.hi.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.fr.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.sv.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.it.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.es.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.cn.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.tr.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.de.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.fa.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.ja.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.pt-br.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.de-ch.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.zh-tw.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.id.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.pl.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.ru.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.kr.md0def iter_first_last(values: iterable[t]) -> iterable[tuple[bool, bool, t]]:
HIGHREADME.hi.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.fr.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.sv.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.it.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.es.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.cn.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.tr.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.de.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.fa.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.ja.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.pt-br.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.de-ch.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.zh-tw.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.id.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.pl.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.ru.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHREADME.kr.md0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHtests/test_syntax.py0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return first = true for value i
HIGHtests/test_syntax.py0iterate and generate a tuple with a flag for first and last value.
HIGHtests/test_syntax.py0iterate and generate a tuple with a flag for first and last value.
HIGHrich/_loop.py0iterate and generate a tuple with a flag for first and last value.
HIGHtests/render.py0link ids have a random id and system path which is a problem for reproducible tests.
HIGHtests/test_log.py0link ids have a random id and system path which is a problem for reproducible tests.
HIGHtests/test_card.py0link ids have a random id and system path which is a problem for reproducible tests.
HIGHtests/test_markdown_no_hyperlinks.py0link ids have a random id and system path which is a problem for reproducible tests.
HIGHtests/test_markdown.py0link ids have a random id and system path which is a problem for reproducible tests.
HIGHrich/live.py0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return for value in iter_values
HIGHrich/progress.py0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return for value in iter_values
HIGHrich/__main__.py0iter_values = iter(values) try: previous_value = next(iter_values) except stopiteration: return for value in iter_values
Hyper-Verbose Identifiers215 hits · 234 pts
SeverityFileLineSnippet
LOWtests/test_pretty.py65def test_ipy_display_hook__repr_html() -> None:
LOWtests/test_pretty.py79def test_ipy_display_hook__multiple_special_reprs() -> None:
LOWtests/test_pretty.py101def test_ipy_display_hook__no_special_repr_methods() -> None:
LOWtests/test_pretty.py113def test_ipy_display_hook__special_repr_raises_exception() -> None:
LOWtests/test_pretty.py137def test_ipy_display_hook__console_renderables_on_newline() -> None:
LOWtests/test_pretty.py234def test_pretty_namedtuple_length_one_no_trailing_comma() -> None:
LOWtests/test_pretty.py239def test_pretty_namedtuple_empty() -> None:
LOWtests/test_pretty.py244def test_pretty_namedtuple_custom_repr() -> None:
LOWtests/test_pretty.py252def test_pretty_namedtuple_fields_invalid_type() -> None:
LOWtests/test_pretty.py261def test_pretty_namedtuple_max_depth() -> None:
LOWtests/test_pretty.py312def test_reference_cycle_container() -> None:
LOWtests/test_pretty.py330def test_reference_cycle_namedtuple() -> None:
LOWtests/test_pretty.py347def test_reference_cycle_dataclass() -> None:
LOWtests/test_pretty.py370def test_reference_cycle_attrs() -> None:
LOWtests/test_pretty.py393def test_reference_cycle_custom_repr() -> None:
LOWtests/test_pretty.py730def test_tuple_rich_repr_default() -> None:
LOWtests/test_pretty.py742def test_dataclass_no_attribute() -> None:
LOWtests/test_filesize.py17def test_pick_unit_and_suffix():
LOWtests/test_tree.py18def test_render_single_branch():
LOWtests/test_tree.py30def test_render_double_branch():
LOWtests/test_logging.py64def test_exception_with_extra_lines():
LOWtests/test_logging.py94def test_stderr_and_stdout_are_none(monkeypatch):
LOWtests/test_logging.py125def test_markup_and_highlight():
LOWtests/test_win32_console.py30 def test_windows_coordinates_to_ctype():
LOWtests/test_win32_console.py123 def test_write_styled_reverse(
LOWtests/test_win32_console.py140 def test_write_styled_reverse(
LOWtests/test_win32_console.py157 def test_write_styled_no_foreground_color(
LOWtests/test_win32_console.py174 def test_write_styled_no_background_color(
LOWtests/test_win32_console.py263 def test_move_cursor_to_out_of_bounds_row(
LOWtests/test_win32_console.py274 def test_move_cursor_to_out_of_bounds_col(
LOWtests/test_win32_console.py321 def test_move_cursor_forward_newline_wrap(
LOWtests/test_win32_console.py338 def test_move_cursor_to_column(
LOWtests/test_win32_console.py348 def test_move_cursor_backward(
LOWtests/test_win32_console.py358 def test_move_cursor_backward_prev_line_wrap(
LOWtests/test_console.py243def test_print_json_ensure_ascii() -> None:
LOWtests/test_console.py252def test_print_json_with_default_ensure_ascii() -> None:
LOWtests/test_console.py261def test_print_json_indent_none() -> None:
LOWtests/test_console.py82def test_console_options_update() -> None:
LOWtests/test_console.py106def test_console_options_update_height() -> None:
LOWtests/test_console.py155def test_size_can_fall_back_to_std_descriptors(
LOWtests/test_console.py164 def get_terminal_size_mock_impl(fileno: int = None) -> Tuple[int, int]:
LOWtests/test_console.py195def test_print_empty_with_end() -> None:
LOWtests/test_console.py448def test_justify_renderable_none() -> None:
LOWtests/test_console.py460def test_justify_renderable_left() -> None:
LOWtests/test_console.py472def test_justify_renderable_center() -> None:
LOWtests/test_console.py484def test_justify_renderable_right() -> None:
LOWtests/test_console.py504def test_render_broken_renderable() -> None:
LOWtests/test_console.py551def test_export_svg_specified_unique_id() -> None:
LOWtests/test_console.py837def test_update_options_markup() -> None:
LOWtests/test_console.py872def test_is_terminal_broken_file() -> None:
LOWtests/test_console.py915def test_render_lines_height_minus_vertical_pad_is_negative() -> None:
LOWtests/test_console.py930def test_recording_no_stdout_and_no_stderr_files(monkeypatch) -> None:
LOWtests/test_console.py943def test_capturing_no_stdout_and_no_stderr_files(monkeypatch) -> None:
LOWtests/test_console.py980def test_reenable_highlighting() -> None:
LOWtests/test_syntax.py75def test_python_render_simple() -> None:
LOWtests/test_syntax.py90def test_python_render_simple_passing_lexer_instance() -> None:
LOWtests/test_syntax.py106def test_python_render_simple_indent_guides() -> None:
LOWtests/test_syntax.py123def test_python_render_line_range_indent_guides() -> None:
LOWtests/test_syntax.py140def test_python_render_indent_guides() -> None:
LOWtests/test_syntax.py160def test_pygments_syntax_theme_non_str() -> None:
155 more matches not shown…
Unused Imports86 hits · 86 pts
SeverityFileLineSnippet
LOWtests/test_cells.py1
LOWtests/test_unicode_data.py1
LOWrich/screen.py9
LOWrich/screen.py9
LOWrich/screen.py9
LOWrich/screen.py9
LOWrich/logging.py1
LOWrich/measure.py8
LOWrich/measure.py8
LOWrich/measure.py8
LOWrich/tree.py4
LOWrich/tree.py4
LOWrich/console.py60
LOWrich/box.py7
LOWrich/color.py14
LOWrich/_fileno.py1
LOWrich/align.py11
LOWrich/align.py11
LOWrich/align.py11
LOWrich/_wrap.py1
LOWrich/_log_render.py8
LOWrich/_log_render.py8
LOWrich/emoji.py10
LOWrich/emoji.py10
LOWrich/containers.py14
LOWrich/containers.py14
LOWrich/containers.py14
LOWrich/containers.py14
LOWrich/containers.py14
LOWrich/containers.py14
LOWrich/control.py7
LOWrich/control.py7
LOWrich/__init__.py6
LOWrich/file_proxy.py8
LOWrich/constrain.py7
LOWrich/constrain.py7
LOWrich/constrain.py7
LOWrich/constrain.py7
LOWrich/pretty.py50
LOWrich/pretty.py50
LOWrich/pretty.py50
LOWrich/pretty.py50
LOWrich/pretty.py50
LOWrich/pretty.py50
LOWrich/markdown.py1
LOWrich/text.py33
LOWrich/text.py33
LOWrich/text.py33
LOWrich/live.py1
LOWrich/live.py6
LOWrich/syntax.py1
LOWrich/table.py28
LOWrich/table.py28
LOWrich/table.py28
LOWrich/table.py28
LOWrich/table.py28
LOWrich/segment.py29
LOWrich/segment.py29
LOWrich/progress.py1
LOWrich/progress.py14
26 more matches not shown…
Cross-Language Confusion14 hits · 84 pts
SeverityFileLineSnippet
HIGHtests/test_stack.py6 stack.push("foo")
HIGHtests/test_stack.py7 stack.push("bar")
HIGHtests/test_console.py271 # When stdout and stderr are null, Console.file should be replaced with NullFile
HIGHtests/test_console.py221 console.print_json('[false, true, null, "foo"]', indent=4)
HIGHtests/test_rich_print.py35 rich.print_json('[false, true, null, "foo"]', indent=4)
HIGHtests/test_rich_print.py38 expected = '[\n false,\n true,\n null,\n "foo"\n]\n'
HIGHtests/test_style.py185 stack.push(Style(bold=True))
HIGHrich/logging.py180 # Handles pythonw, where stdout/stderr are null, and we return NullFile
HIGHrich/tree.py171 style_stack.push(get_style(node.style))
HIGHrich/tree.py172 guide_style_stack.push(get_style(node.guide_style))
HIGHrich/markdown.py504 self.style_stack.push(style)
HIGHrich/markdown.py618 context.stack.push(Link.create(self, token))
HIGHrich/markdown.py670 context.stack.push(element)
HIGHrich/highlighter.py117 r"\b(?P<bool_true>true)\b|\b(?P<bool_false>false)\b|\b(?P<null>null)\b",
Docstring Block Structure13 hits · 65 pts
SeverityFileLineSnippet
HIGHrich/measure.py82Get a measurement for a renderable. Args: console (~rich.console.Console): Console instance.
HIGHrich/console.py823Set Live instance. Used by Live context manager (no need to call directly). Args: live (Live): Live
HIGHrich/console.py1473Get a Style instance by its theme name or parse a definition. Args: name (str): The name of a style
HIGHrich/console.py1912Get caller frame information. Args: offset (int): the caller offset within the current frame stack.
HIGHrich/style.py499Parse a style definition. Args: style_definition (str): A string containing a style. Raise
HIGHrich/markup.py112Render console markup in to a Text instance. Args: markup (str): A string containing console markup.
HIGHrich/highlighter.py21Highlight a str or Text instance. Args: text (Union[str, ~Text]): Text to highlight. Raise
HIGHrich/progress_bar.py129Renders the pulse animation. Args: console (Console): Console instance. width (int): Wi
HIGHrich/prompt.py228Process response from user, convert to prompt type. Args: value (str): String typed by user.
HIGHrich/progress.py1245Track progress file reading from a binary file. Args: file (BinaryIO): A file-like object opened in
HIGHrich/progress.py1324Track progress while reading from a binary file. Args: path (Union[str, PathLike[str]]): The path t
HIGHrich/_win32_console.py96Retrieves the current input mode of a console's input buffer or the current output mode of a console screen buffer.
HIGHrich/_unicode_data/__init__.py32Parse a version string into a tuple of 3 integers. Args: version: A version string. Raises: Va
Deep Nesting55 hits · 54 pts
SeverityFileLineSnippet
LOWtests/test_progress.py647
LOWtests/test_traceback.py13
LOWexamples/print_calendar.py20
LOWrich/tree.py86
LOWrich/console.py383
LOWrich/console.py619
LOWrich/console.py1500
LOWrich/console.py1652
LOWrich/console.py2059
LOWrich/console.py2244
LOWrich/box.py115
LOWrich/color.py349
LOWrich/color.py485
LOWrich/color.py513
LOWrich/align.py143
LOWrich/align.py161
LOWrich/style.py344
LOWrich/style.py498
LOWrich/_wrap.py26
LOWrich/containers.py111
LOWrich/traceback.py56
LOWrich/traceback.py433
LOWrich/traceback.py768
LOWrich/markup.py106
LOWrich/repr.py36
LOWrich/repr.py41
LOWrich/repr.py42
LOWrich/repr.py67
LOWrich/pretty.py580
LOWrich/pretty.py424
LOWrich/pretty.py621
LOWrich/pretty.py633
LOWrich/columns.py62
LOWrich/_inspect.py125
LOWrich/markdown.py579
LOWrich/text.py817
LOWrich/text.py964
LOWrich/text.py1106
LOWrich/highlighter.py123
LOWrich/live.py145
LOWrich/live.py244
LOWrich/syntax.py470
LOWrich/syntax.py652
LOWrich/table.py523
LOWrich/table.py755
LOWrich/segment.py247
LOWrich/segment.py276
LOWrich/segment.py307
LOWrich/segment.py354
LOWrich/segment.py630
LOWrich/ansi.py138
LOWrich/progress.py1311
LOWrich/cells.py113
LOWrich/cells.py161
LOWrich/_windows_renderer.py7
Excessive Try-Catch Wrapping46 hits · 50 pts
SeverityFileLineSnippet
LOWtests/test_inspect.py381 except Exception as e:
LOWtests/test_inspect.py416 except Exception as e:
LOWtests/test_repr.py69 except Exception:
MEDIUMtests/test_traceback.py63def test_capture():
MEDIUMtests/test_traceback.py286def test_suppress():
MEDIUMtests/test_traceback.py386def foo() -> None:
MEDIUMtests/test_traceback.py392def bar() -> None:
LOWtests/test_traceback.py97 except Exception:
LOWtests/test_traceback.py107 except Exception:
LOWtests/test_traceback.py118 except Exception:
LOWtests/test_traceback.py196 except Exception:
LOWtests/test_traceback.py206 except Exception:
LOWtests/test_traceback.py27 except Exception:
LOWtests/test_traceback.py66 except Exception:
LOWtests/test_traceback.py147 except Exception:
LOWtests/test_traceback.py174 except Exception:
LOWtests/test_traceback.py228 except Exception:
LOWtests/test_traceback.py244 except Exception:
LOWtests/test_traceback.py370 except Exception as error:
LOWtests/test_traceback.py389 except Exception as e:
LOWtests/test_traceback.py395 except Exception as e:
LOWtests/test_traceback.py278 except Exception:
LOWtests/test_traceback.py289 except Exception:
LOWtests/test_traceback.py323 except Exception:
LOWexamples/exception.py25 except Exception:
LOWexamples/recursive_error.py24except Exception:
LOWrich/logging.py187 except Exception:
LOWrich/console.py81except Exception:
LOWrich/console.py85except Exception:
LOWrich/console.py89except Exception:
LOWrich/_fileno.py19 except Exception:
LOWrich/traceback.py214 except Exception:
LOWrich/traceback.py480 except Exception:
LOWrich/traceback.py858 except Exception as error:
LOWrich/markup.py195 except Exception as error:
LOWrich/repr.py84 except Exception as error:
LOWrich/pretty.py86 except Exception: # pragma: no coverage
LOWrich/pretty.py167 except Exception:
LOWrich/pretty.py574 except Exception:
LOWrich/pretty.py613 except Exception as error:
LOWrich/pretty.py653 except Exception:
LOWrich/pretty.py661 except Exception:
LOWrich/pretty.py739 except Exception as error:
LOWrich/_inspect.py136 except Exception as error:
LOWrich/live.py134 except Exception:
LOWrich/json.py135 except Exception as error:
Fake / Example Data13 hits · 10 pts
SeverityFileLineSnippet
LOWtools/profile_divide.py3text = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
LOWtools/profile_divide.py3text = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
LOWtests/test_markdown_no_hyperlinks.py47> Lorem ipsum
LOWtests/test_markdown_no_hyperlinks.py96 expected = " \x1b[1;4mHeading\x1b[0m
LOWtests/_card_render.py1expected = "\x1b[3m Rich features \
LOWtests/test_markdown.py47> Lorem ipsum
LOWtests/test_markdown.py102 expected = " \x1b[1;4mHeading\x1b[0m
LOWbenchmarks/snippets.py94Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWbenchmarks/snippets.py94Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWrich/text.py1342 """\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolo
LOWrich/text.py1342 """\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolo
LOWrich/__main__.py71 lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in metus sed sapien ultricies pretium a at
LOWrich/__main__.py71 lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in metus sed sapien ultricies pretium a at
Over-Commented Block4 hits · 4 pts
SeverityFileLineSnippet
LOWdocs/source/conf.py1# Configuration file for the Sphinx documentation builder.
LOW.github/workflows/codeql.yml41 # Prefix the list here with "+" to use these queries and those in the config file.
LOWrich/highlighter.py161 #
LOWrich/highlighter.py181 # Calendar date with hours, minutes, and seconds (e.g., 2008-08-30 17:21:59 or 20080830 172159).
Self-Referential Comments2 hits · 2 pts
SeverityFileLineSnippet
MEDIUMrich/console.py2031 """This function is called when a `BrokenPipeError` is raised.
MEDIUMrich/align.py40 # Create a panel 20 characters wide