Drapegnik/bsu

View on GitHub
architecture/lab3-poisson/task.py

Summary

Maintainability
C
1 day
Test Coverage

Function __init__ has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, full_region, region, left_top, step_x, step_y):
        self.full_region, self.region, self.left_top, self.step_x, self.step_y = full_region, region, left_top, step_x, step_y
        self.rows = region.bottom - region.top
        self.cols = region.right - region.left
        self.calc_region = Region(
Severity: Minor
Found in architecture/lab3-poisson/task.py - About 4 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 set has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def set(self, i, j, val):
        if j == -1:
            self.neighbor_left_border[i] = val
        elif j == self.cols:
            self.neighbor_right_border[i] = val
Severity: Minor
Found in architecture/lab3-poisson/task.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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, i, j):
        if j == -1:
            return self.neighbor_left_border[i]
        elif j == self.cols:
            return self.neighbor_right_border[i]
Severity: Minor
Found in architecture/lab3-poisson/task.py - About 55 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

Function exch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def exch(self, comm):
        left, right = comm.Shift(1, 1)
        top, bottom = comm.Shift(0, 1)

        if top != MPI.PROC_NULL:
Severity: Minor
Found in architecture/lab3-poisson/task.py - About 45 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

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

    def __init__(self, full_region, region, left_top, step_x, step_y):
Severity: Minor
Found in architecture/lab3-poisson/task.py - About 35 mins to fix

    Avoid too many return statements within this function.
    Open

                return self.top_border[j]
    Severity: Major
    Found in architecture/lab3-poisson/task.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return self.bottom_border[j]
      Severity: Major
      Found in architecture/lab3-poisson/task.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return self.right_border[i]
        Severity: Major
        Found in architecture/lab3-poisson/task.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return self.left_border[i]
          Severity: Major
          Found in architecture/lab3-poisson/task.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return self.inner_lines[i - 1][j - 1]
            Severity: Major
            Found in architecture/lab3-poisson/task.py - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status