maestro-server/analytics-maestro

View on GitHub

Showing 299 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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def error_handling(self, task, msg):
        
            if self.ent_id:
                return notify_error(task=task, msg=msg, graph_id=self.ent_id)
    
    
    Severity: Major
    Found in app/repository/externalMaestroAnalyticsFront.py and 1 other location - About 1 hr to fix
    app/repository/externalMaestroData.py on lines 18..23

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 42.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def error_handling(self, task, msg):
    
            if self.ent_id :
                return notify_error(task=task, msg=msg, graph_id=self.ent_id)
    
    
    Severity: Major
    Found in app/repository/externalMaestroData.py and 1 other location - About 1 hr to fix
    app/repository/externalMaestroAnalyticsFront.py on lines 15..20

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 42.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

                for i in range(diff):
                    posy = start_y + i
                    self._grid.create_dummy((self._step, posy))
    Severity: Minor
    Found in app/libs/patterns/balance.py and 1 other location - About 55 mins to fix
    app/libs/patterns/balance.py on lines 48..50

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

                    for i in range(diff):
                        posy = start_y + i
                        self._grid.create_dummy((self._step, posy))
    Severity: Minor
    Found in app/libs/patterns/balance.py and 1 other location - About 55 mins to fix
    app/libs/patterns/balance.py on lines 31..33

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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 __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 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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                if self._grid.in_index(node):
                    idx = self._grid.get_index(node)
                    return idx[0]
        Severity: Minor
        Found in app/libs/helpers/define.py and 1 other location - About 40 mins to fix
        app/libs/helpers/define.py on lines 22..24

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 34.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                if self._grid.in_index(node):
                    idx = self._grid.get_index(node)
                    return idx[0]
        Severity: Minor
        Found in app/libs/helpers/define.py and 1 other location - About 40 mins to fix
        app/libs/helpers/define.py on lines 7..9

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 34.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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 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 __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 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 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

                      Severity
                      Category
                      Status
                      Source
                      Language