maestro-server/analytics-maestro

View on GitHub

Showing 22 of 299 total issues

PosMatrix3D has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class PosMatrix3D(object):
    def __init__(self, size, pos, off):
        self._size = size
        self._off = off
        self._pos = pos
Severity: Minor
Found in app/libs/matrix_rotation/posMatrix.py - About 2 hrs to fix

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

        def byServer(server, dft='premise'):
    
            if isinstance(server, dict):
                dc = server.get('datacenters')
                if dc:
    Severity: Minor
    Found in app/libs/dcApp.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 findDC has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def findDC(self, app, dft='premise'):
            servers = app.get('servers', [])
            dc = []
    
            if len(servers) > 0:
    Severity: Minor
    Found in app/libs/dcServer.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 cleanning has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def cleanning(self, grid):
    
            grid = collections.OrderedDict(sorted(grid.items()))
    
            for row in grid:
    Severity: Minor
    Found in app/libs/helpers/clearEmptyLines.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 _factory_matrix has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _factory_matrix(self, pos, size, alloc='mid', point='node', view='front', om=(0, 0)):
    Severity: Minor
    Found in app/libs/drawing/helpers/connector/drawPointerConnector.py - About 45 mins to fix

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

          def __init__(self, off, size, max_x, max_y, grid, mrotation=MatrixRotation):
      Severity: Minor
      Found in app/libs/drawing/areaSVG.py - About 45 mins to fix

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

        def task_info_bussiness(owner_id, graph_id, grid, index, info):
        Severity: Minor
        Found in app/tasks/network_info.py - About 35 mins to fix

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

              def asset(self, asset, template, pos, size, opts={}):
          Severity: Minor
          Found in app/libs/template/symbolAssets.py - About 35 mins to fix

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

            def task_enrichment(owner_id, graph_id, grid, index, edges):
            Severity: Minor
            Found in app/tasks/enrichment_apps.py - About 35 mins to fix

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

                  def __init__(self, tmax, grid, darea=DrawArea, symbols=SymbolAssets, m3d=Matrix3D):
              Severity: Minor
              Found in app/libs/drawing/templateSVG.py - About 35 mins to fix

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

                    def first_step(self, fpos, spos, fsize, ssize, diffs):
                Severity: Minor
                Found in app/libs/drawing/helpers/connector/drawConnector.py - About 35 mins to fix

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

                  def task_draw_bussiness(owner_id, graph_id, grid, index, edges):
                  Severity: Minor
                  Found in app/tasks/draw_bussiness.py - About 35 mins to fix

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

                        def ellipse(self, cx, cy, rx, ry, class_):
                    Severity: Minor
                    Found in app/libs/template/symbol.py - About 35 mins to fix

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

                          def push(self, sys):
                      
                              if (sys is not None) and isinstance(sys, list):
                                  for item in sys:
                                      _id = item.get('_id')
                      Severity: Minor
                      Found in app/libs/helpers/reduceDict.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

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

                          def push(self, sys):
                      
                              if (sys is not None) and isinstance(sys, list):
                                  for item in sys:
                                      _id = item.get('_id')
                      Severity: Minor
                      Found in app/libs/helpers/reduceClients.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

                      Function predecessors_balance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def predecessors_balance(self, step_pace=1):
                              preds = self._helper.grab_drawed_predecers()
                              succers_size = len(preds)
                      
                              if succers_size > 0:
                      Severity: Minor
                      Found in app/libs/patterns/balance.py - About 25 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 second_step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def second_step(self, fpos, diffs):
                              cx = fpos[0] + 1
                              cy = fpos[1]
                      
                              if (cx in self._matrix3d._grid) and (cy in self._matrix3d._grid[cx]):
                      Severity: Minor
                      Found in app/libs/drawing/helpers/connector/drawConnector.py - About 25 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 shw_empty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def shw_empty(self):
                              x = self._max_x
                              y = self._max_y
                      
                              counter = 0
                      Severity: Minor
                      Found in app/libs/drawing/areaSVG.py - About 25 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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def post(self):
                      
                              valid = Validate().validate()
                      
                              if valid:
                      Severity: Minor
                      Found in app/controller/graph.py - About 25 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 default has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def default(self, obj):
                              val = None
                      
                              if isinstance(obj, (datetime.datetime, datetime.date, datetime.time)):
                                  val = obj.isoformat()
                      Severity: Minor
                      Found in app/libs/jsonEncoder.py - About 25 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

                      Severity
                      Category
                      Status
                      Source
                      Language