AndresMWeber/Forge

View on GitHub

Showing 36 of 36 total issues

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

    @classmethod
    def factory(cls, node_dag='', **kwargs):
        cls.LOG.debug('<%s>.factory running with dag node reference: %r' % (cls.__name__, node_dag))
        if isinstance(node_dag, dict):
            cls.LOG.debug('\t\tDetected serialzation, deserializing and instancing with args %s' % node_dag)
Severity: Major
Found in forge/core/nodes/abstract/node.py and 1 other location - About 1 day to fix
forge/components/element.py on lines 226..241

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 148.

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

    @classmethod
    def factory(cls, node_dag='', **kwargs):
        cls.LOG.debug('<%s>.factory running with dag node reference: %r' % (cls.__name__, node_dag))
        if isinstance(node_dag, dict):
            cls.LOG.debug('\t\tDetected serialzation, deserializing and instancing with args %s' % node_dag)
Severity: Major
Found in forge/components/element.py and 1 other location - About 1 day to fix
forge/core/nodes/abstract/node.py on lines 31..46

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 148.

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

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

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

        def __eq__(self, other):
            base_eq = super(TwistInterpolators, self).__eq__(other)
            return all([base_eq] + [getattr(self, group) == getattr(other, group) for group in self.control])
    Severity: Major
    Found in forge/elements/augmentors/twist_interpolators.py and 1 other location - About 3 hrs to fix
    forge/elements/universal.py on lines 78..80

    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 64.

    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

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

        def __eq__(self, other):
            base_eq = super(Universal, self).__eq__(other)
            return all([base_eq] + [getattr(self, group) == getattr(other, group) for group in self.control])
    Severity: Major
    Found in forge/elements/universal.py and 1 other location - About 3 hrs to fix
    forge/elements/augmentors/twist_interpolators.py on lines 80..82

    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 64.

    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

    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

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

          def position(self, t=(0.0, 0.0, 0.0), world_space=True, q=False):
              t = t if not q else q
              return mc.xform(self.node, q=q, os=not world_space, ws=world_space, t=t)
      Severity: Major
      Found in forge/core/nodes/maya/transform.py and 1 other location - About 2 hrs to fix
      forge/core/nodes/maya/transform.py on lines 55..57

      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 60.

      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

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

          def rotation(self, r=(0.0, 0.0, 0.0), world_space=True, q=False):
              r = r if not q else q
              return mc.xform(self.node, q=q, os=not world_space, ws=world_space, ro=r)
      Severity: Major
      Found in forge/core/nodes/maya/transform.py and 1 other location - About 2 hrs to fix
      forge/core/nodes/maya/transform.py on lines 51..53

      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 60.

      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

      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

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

            xform_interps = transformation.spatial_interpolate(pm.xform(start_xform, q=True, t=True, ws=True),
                                                               pm.xform(end_xform, q=True, t=True, ws=True),
                                                               n_joints)
        Severity: Major
        Found in forge/core/core_utils/maya_utils/joint.py and 1 other location - About 1 hr to fix
        forge/core/core_utils/maya_utils/joint.py on lines 214..216

        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 45.

        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

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

            rotation_interps = transformation.spatial_interpolate(pm.xform(start_xform, q=True, ro=True, ws=True),
                                                                  pm.xform(end_xform, q=True, ro=True, ws=True),
                                                                  n_joints)
        Severity: Major
        Found in forge/core/core_utils/maya_utils/joint.py and 1 other location - About 1 hr to fix
        forge/core/core_utils/maya_utils/joint.py on lines 210..212

        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 45.

        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 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
              Severity
              Category
              Status
              Source
              Language