AndresMWeber/Forge

View on GitHub

Showing 26 of 36 total issues

AbstractNode has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class AbstractNode(SerializationMixin):
    LOG = forge.settings.get_module_logger(__name__, module_override_level=MODULE_LOGGER_LEVEL_OVERRIDE)
    INTERNAL_TYPE = 'node'
    ENGINE_TYPE = None
    NAME_DEFAULTS = {'name': 'untitled'}
Severity: Minor
Found in forge/core/nodes/abstract/node.py - About 3 hrs to fix

    Function build_from_points has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def build_from_points(transforms, chain=False, parent=None, offset=False, freeze=True, **kwargs):
        """ Create joints based on given 3D spatial positions/rotations e.g. [[[10,5.3,1.4],[0,90,0]],...,nPos]
        Args:
            transforms [[float,float,float]] or [pm.nt.Transform]: 
                list of transforms xyz coordinate + euler rotation based or pm.nt.Transform
    Severity: Minor
    Found in forge/core/core_utils/maya_utils/joint.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

    Element has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Element(serializer.SerializationMixin):
        LOG = forge.settings.get_module_logger(__name__, module_override_level=MODULE_LOGGER_LEVEL_OVERRIDE)
        LAYOUT_GUIDE_JOINTS = {}
        VISIBILITY_TYPES = [settings.MODEL_TYPE, settings.JOINT_TYPE, settings.CONTROL_TYPE]
        ENUM_DISPLAY_TYPE = 'normal:template:reference'
    Severity: Minor
    Found in forge/components/element.py - About 3 hrs to fix

      MayaNode has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class MayaNode(AbstractNode):
          """
               Wraps a dag_path with generic functions to manipulate a maya_utils node
          """
          ENGINE_TYPE = 'group'
      Severity: Minor
      Found in forge/core/nodes/maya/node.py - About 2 hrs to fix

        Function recreate_constraint has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def recreate_constraint(constraint_in, source, target, mo=True):
            """ Recreates a constraint from the given example to a source and target
            Args:
                constraint_in (pm.PyNode): constraint to model after
                source (pm.nt.Transform): object to do the constraining
        Severity: Minor
        Found in forge/core/core_utils/maya_utils/hierarchy.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 replace_set_members has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def replace_set_members(top_group_source, top_group_target, starts_with='cacheSet', delete=True):
            """ This script assumes that only ONE set is the actual set that these objects are added to 
                and that it's an ftrack cache set by default
            Args:
                top_group_source (pm.nt.Transform): top group of the source objects to get sets
        Severity: Minor
        Found in forge/core/core_utils/maya_utils/hierarchy.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 get_scene_tree has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_scene_tree():
            startup_cams = [mc.listRelatives(c, p=True)[0] for c in mc.ls(cameras=True)
                            if mc.camera(c, q=True, startupCamera=True)]
        
            top_level_transforms = [node for node in mc.ls(assemblies=True)
        Severity: Minor
        Found in forge/core/core_utils/maya_utils/scene.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 yield_nodes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def yield_nodes(self):
                def yield_nodes_from_serialization(d):
                    for k, v in iteritems(d):
                        if isinstance(v, dict):
                            for item in yield_nodes_from_serialization(v):
        Severity: Minor
        Found in forge/components/element.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 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self,
        Severity: Major
        Found in forge/components/element.py - About 1 hr to fix

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

          def make_joints_along_curve(curve, num_joints=0, rebuild=False, parent=None, **kwargs):
              """ Create joints along a curve in the same direction as the curve
              :param curve: pm.PyNode, the curve transform to be used
              :param name: 
              :param num_joints: int, the number of joints to be created, if 0 will use CVs
          Severity: Minor
          Found in forge/core/core_utils/maya_utils/joint.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 factory has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def factory(cls,
          Severity: Major
          Found in forge/components/element.py - About 1 hr to fix

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

            def build_between_points(start_xform, end_xform, n_joints, freeze=True, chain=True, parent=None, offset=False,
            Severity: Major
            Found in forge/core/core_utils/maya_utils/joint.py - About 1 hr to fix

              Function safe_delete has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def safe_delete(node_or_nodes):
                  if isinstance(node_or_nodes, list):
                      for node in node_or_nodes:
                          try:
                              mc.delete(node)
              Severity: Minor
              Found in forge/core/core_utils/maya_utils/scene.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 create has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def create(cls, node_type='group', move_style='match', reference_transform_dag='', parent=None, *args, **kwargs):
              Severity: Minor
              Found in forge/core/nodes/maya/transform.py - About 45 mins to fix

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

                    def __init__(self, node_dag='', control_offset_grp='', control_con_grp='', scale=1.0, rename=False, **kwargs):
                Severity: Minor
                Found in forge/core/nodes/abstract/control.py - About 45 mins to fix

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

                      def serialize_element(self):
                          """ Serialization function to correctly serialize an element
                              TODO: Merge this with the generic serializer.
                  
                          :return: dict, serialization of the Element instance
                  Severity: Minor
                  Found in forge/core/nodes/serializer.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 build_from_points has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def build_from_points(transforms, chain=False, parent=None, offset=False, freeze=True, **kwargs):
                  Severity: Minor
                  Found in forge/core/core_utils/maya_utils/joint.py - About 45 mins to fix

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

                        def create(cls, shape='cube', scale=1.0, lock_channelbox=None, parent='', **kwargs):
                    Severity: Minor
                    Found in forge/core/nodes/abstract/control.py - About 35 mins to fix

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

                      def make_joints_along_curve(curve, num_joints=0, rebuild=False, parent=None, **kwargs):
                      Severity: Minor
                      Found in forge/core/core_utils/maya_utils/joint.py - About 35 mins to fix

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

                        def insert_between_joints(start_joint, end_joint, joint_num, bone_translate_axis='tx', **kwargs):
                        Severity: Minor
                        Found in forge/core/core_utils/maya_utils/joint.py - About 35 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language