dotanuki-labs/bitrise-reports

View on GitHub
bitrise_reports/reporting.py

Summary

Maintainability
C
7 hrs
Test Coverage

Function report has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def report(self, breakdowns):

        self.sheet.column_dimensions["A"].width = 25

        for column in ["A", "B", "C", "D", "E", "F", "G", "H", "I"]:
Severity: Minor
Found in bitrise_reports/reporting.py - About 2 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

Function report_breakdown has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def report_breakdown(self, breakdown):
        printer = self.console
        printer.print(f"\n[bold green]{breakdown.name}[/bold green]")

        table = Table(show_header=True, header_style="bold magenta")
Severity: Minor
Found in bitrise_reports/reporting.py - About 1 hr 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

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in bitrise_reports/reporting.py - About 1 hr to fix

    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in bitrise_reports/reporting.py - About 50 mins to fix

      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Minor
      Found in bitrise_reports/reporting.py - About 45 mins to fix

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, criteria, detailed_builds, detailed_timing, emulate_velocity, console):
        Severity: Minor
        Found in bitrise_reports/reporting.py - About 35 mins to fix

          Function __process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __process(self, breakdown):
                  flattened = {"description": breakdown.name, "details": []}
          
                  sorted_by_total = sorted(
                      breakdown.details.items(), key=lambda kv: kv[1].count, reverse=True
          Severity: Minor
          Found in bitrise_reports/reporting.py - About 35 mins 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

          There are no issues that match your filters.

          Category
          Status