Melevir/opensource_watchman

View on GitHub
opensource_watchman/api/travis.py

Summary

Maintainability
B
4 hrs
Test Coverage
F
53%

Function _extract_commands_from_raw_log has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def _extract_commands_from_raw_log(raw_log: str) -> List[str]:  # noqa: C901
        commands_with_subcommands = [
            # those commands have subcommands that are logged as stdout,
            # those commands should be extracted too
            'make',
Severity: Minor
Found in opensource_watchman/api/travis.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Consider simplifying this complex logical expression.
Open

                    if (
                        not line.strip()
                        or line.startswith('-')
                        or line.startswith('=')
                        or line.startswith('|')
Severity: Critical
Found in opensource_watchman/api/travis.py - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status