cea-sec/miasm

View on GitHub
miasm/core/objc.py

Summary

Maintainability
F
2 wks
Test Coverage

File objc.py has 1424 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
C helper for Miasm:
* raw C to Miasm expression
* Miasm expression to raw C
* Miasm expression to C type
Severity: Major
Found in miasm/core/objc.py - About 3 days to fix

    Function cgen_access has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        def cgen_access(self, cgenobj, base_type, offset, deref, lvl=0):
            """Return the access(es) which lead to the element at @offset of an
            object of type @base_type
    
            In case of no @deref, stops recursion as soon as we reached the base of
    Severity: Minor
    Found in miasm/core/objc.py - About 5 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 reduce_mem has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        def reduce_mem(self, node, lvl=0, **kwargs):
            """Generate access for ExprMem:
            * @NN[ptr<elem>] -> elem  (type)
            * @64[ptr<ptr<elem>>] -> ptr<elem>
            * @32[ptr<struct>] -> struct.00
    Severity: Minor
    Found in miasm/core/objc.py - About 5 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_objc has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        def _get_objc(self, type_id, resolved=None, to_fix=None, lvl=0):
            if resolved is None:
                resolved = {}
            if to_fix is None:
                to_fix = []
    Severity: Minor
    Found in miasm/core/objc.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 objc_to_str has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def objc_to_str(objc, result=None):
        if result is None:
            result = ""
        while True:
            if isinstance(objc, ObjCArray):
    Severity: Minor
    Found in miasm/core/objc.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

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

        def reduce_op_field(self, node, **kwargs):
            """Reduce field operator (Struct or Union)"""
    
            if not node.expr.is_op('field'):
                return None
    Severity: Minor
    Found in miasm/core/objc.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

    Function ast_get_c_access_expr has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def ast_get_c_access_expr(ast, expr_types, lvl=0):
        """Transform C ast object into a C Miasm expression
    
        @ast: parsed pycparser.c_ast object
        @expr_types: a dictionary linking ID names to their types
    Severity: Minor
    Found in miasm/core/objc.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 access_str has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def access_str(expr):
        """Return the C string of a C access represented in Miasm
    
        @expr: Miasm expression representing the C access
    
    
    Severity: Minor
    Found in miasm/core/objc.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 size_to_int has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def size_to_int(self, size):
            """Resolve an array size
            @size: CTypeOp or integer"""
            if isinstance(size, CTypeOp):
                assert len(size.args) == 2
    Severity: Minor
    Found in miasm/core/objc.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

    Consider simplifying this complex logical expression.
    Open

        if (expr.is_op("addr") and
                expr.args[0].is_op("[]") and
                expr.args[0].args[1] == ExprInt(0, 64)):
            return expr.args[0].args[0]
        elif (expr.is_op("[]") and
    Severity: Critical
    Found in miasm/core/objc.py - About 1 hr to fix

      Function check_objc has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_objc(self, objc, done=None):
              """Ensure each sub ObjC is resolved
              @objc: ObjC instance"""
              if done is None:
                  done = set()
      Severity: Minor
      Found in miasm/core/objc.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 reduce_op_array has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def reduce_op_array(self, node, **kwargs):
              """Reduce array operator"""
      
              if not node.expr.is_op('[]'):
                  return None
      Severity: Minor
      Found in miasm/core/objc.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 reduce_op has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def reduce_op(self, node, lvl=0, **kwargs):
              """Generate access for ExprOp"""
              if not (node.expr.is_op("+") or is_op_segm(node.expr)) \
                 or len(node.args) != 2:
                  return None
      Severity: Minor
      Found in miasm/core/objc.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 access_simplifier has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def access_simplifier(expr):
          """Expression visitor to simplify a C access represented in Miasm
      
          @expr: Miasm expression representing the C access
      
      
      Severity: Minor
      Found in miasm/core/objc.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 reduce_op_memberof has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def reduce_op_memberof(self, node, **kwargs):
              """Reduce -> operator"""
      
              if not node.expr.is_op('->'):
                  return None
      Severity: Minor
      Found in miasm/core/objc.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

      Avoid deeply nested control flow statements.
      Open

                              if self.enforce_strict_access and target.size != node.expr.size // 8:
                                  continue
                              found.add(CGenDeref(finalcgenobj))
      Severity: Major
      Found in miasm/core/objc.py - About 45 mins to fix

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

            def __init__(self, name, abi, type_ret, args, void_p_align, void_p_size):
        Severity: Minor
        Found in miasm/core/objc.py - About 45 mins to fix

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

              def __init__(self, struct, field, fieldtype, void_p_align, void_p_size):
          Severity: Minor
          Found in miasm/core/objc.py - About 35 mins to fix

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

                def __init__(self, types_mngr, expr_types=None,
            Severity: Minor
            Found in miasm/core/objc.py - About 35 mins to fix

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

                  def cgen_access(self, cgenobj, base_type, offset, deref, lvl=0):
              Severity: Minor
              Found in miasm/core/objc.py - About 35 mins to fix

                Avoid too many return statements within this function.
                Open

                            return obj.size
                Severity: Major
                Found in miasm/core/objc.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return out
                  Severity: Major
                  Found in miasm/core/objc.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return set([cgenobj])
                    Severity: Major
                    Found in miasm/core/objc.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return arg0 << arg1
                      Severity: Major
                      Found in miasm/core/objc.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return ExprOp("->", expr.args[0].args[0], expr.args[1])
                        Severity: Major
                        Found in miasm/core/objc.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return expr
                          Severity: Major
                          Found in miasm/core/objc.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return True
                            Severity: Major
                            Found in miasm/core/objc.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return new_type
                              Severity: Major
                              Found in miasm/core/objc.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return set()
                                Severity: Major
                                Found in miasm/core/objc.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return set()
                                  Severity: Major
                                  Found in miasm/core/objc.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return set()
                                    Severity: Major
                                    Found in miasm/core/objc.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return set([cgenobj])
                                      Severity: Major
                                      Found in miasm/core/objc.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                        return set([curobj])
                                        Severity: Major
                                        Found in miasm/core/objc.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                          return arg0 >> arg1
                                          Severity: Major
                                          Found in miasm/core/objc.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                        return size
                                            Severity: Major
                                            Found in miasm/core/objc.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                              return set()
                                              Severity: Major
                                              Found in miasm/core/objc.py - About 30 mins to fix

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

                                                    def reduce_op_addr(self, node, **kwargs):
                                                        """Reduce addr operator"""
                                                
                                                        if not node.expr.is_op('addr'):
                                                            return None
                                                Severity: Minor
                                                Found in miasm/core/objc.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 reduce_op_deref has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def reduce_op_deref(self, node, **kwargs):
                                                        """Reduce deref operator"""
                                                
                                                        if not node.expr.is_op('deref'):
                                                            return None
                                                Severity: Minor
                                                Found in miasm/core/objc.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

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

                                                        if isinstance(struct_dst, ObjCStruct):
                                                            found = False
                                                            for name, objtype, offset, _ in struct_dst.fields:
                                                                if name != field:
                                                                    continue
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 7 hrs to fix
                                                miasm/core/objc.py on lines 1283..1300

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

                                                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

                                                        elif isinstance(struct_dst, ObjCUnion):
                                                            found = False
                                                            for name, objtype, offset, _ in struct_dst.fields:
                                                                if name != field:
                                                                    continue
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 7 hrs to fix
                                                miasm/core/objc.py on lines 1265..1282

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __lt__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            if ret < 0:
                                                                return True
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 2 hrs to fix
                                                miasm/core/objc.py on lines 146..152
                                                miasm/core/objc.py on lines 212..218
                                                miasm/core/objc.py on lines 294..300
                                                miasm/core/objc.py on lines 336..342

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __lt__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            if ret < 0:
                                                                return True
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 2 hrs to fix
                                                miasm/core/objc.py on lines 146..152
                                                miasm/core/objc.py on lines 212..218
                                                miasm/core/objc.py on lines 294..300
                                                miasm/core/objc.py on lines 393..399

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __lt__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            if ret < 0:
                                                                return True
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 2 hrs to fix
                                                miasm/core/objc.py on lines 146..152
                                                miasm/core/objc.py on lines 212..218
                                                miasm/core/objc.py on lines 336..342
                                                miasm/core/objc.py on lines 393..399

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __lt__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            if ret < 0:
                                                                return True
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 2 hrs to fix
                                                miasm/core/objc.py on lines 212..218
                                                miasm/core/objc.py on lines 294..300
                                                miasm/core/objc.py on lines 336..342
                                                miasm/core/objc.py on lines 393..399

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __lt__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            if ret < 0:
                                                                return True
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 2 hrs to fix
                                                miasm/core/objc.py on lines 146..152
                                                miasm/core/objc.py on lines 294..300
                                                miasm/core/objc.py on lines 336..342
                                                miasm/core/objc.py on lines 393..399

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

                                                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 c_to_type(self, c_str, c_context=None):
                                                        """Get the type of a C string expression
                                                        @expr: Miasm expression
                                                        @c_context: (optional) dictionary linking known tokens (strings) to its
                                                        type.
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 1 hr to fix
                                                miasm/core/objc.py on lines 1736..1746

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

                                                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 c_to_expr(self, c_str, c_context=None):
                                                        """Convert a C string expression to a Miasm expression
                                                        @c_str: C string
                                                        @c_context: (optional) dictionary linking known tokens (strings) to its
                                                        type.
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 1 hr to fix
                                                miasm/core/objc.py on lines 1748..1758

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

                                                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):
                                                        return (super(CGenField, self).__eq__(other) and
                                                                self._base == other.base and
                                                                self._elems == other.elems)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 1 hr to fix
                                                miasm/core/objc.py on lines 625..628

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

                                                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):
                                                        return (super(CGenField, self).__eq__(other) and
                                                                self._struct == other.struct and
                                                                self._field == other.field)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 1 hr to fix
                                                miasm/core/objc.py on lines 702..705

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

                                                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 __init__(self, name, align, size, fields):
                                                        super(ObjCUnion, self).__init__(align, size)
                                                        self._name = name
                                                        self._fields = tuple(fields)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 1 hr to fix
                                                miasm/core/objc.py on lines 265..268

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

                                                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 __init__(self, name, align, size, fields):
                                                        super(ObjCStruct, self).__init__(align, size)
                                                        self._name = name
                                                        self._fields = tuple(fields)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 1 other location - About 1 hr to fix
                                                miasm/core/objc.py on lines 307..310

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            return False
                                                        return self.name == other.name
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 140..144
                                                miasm/core/objc.py on lines 206..210
                                                miasm/core/objc.py on lines 330..334
                                                miasm/core/objc.py on lines 387..391

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            return False
                                                        return self.name == other.name
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 140..144
                                                miasm/core/objc.py on lines 206..210
                                                miasm/core/objc.py on lines 288..292
                                                miasm/core/objc.py on lines 330..334

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            return False
                                                        return self.objtype == other.objtype
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 140..144
                                                miasm/core/objc.py on lines 288..292
                                                miasm/core/objc.py on lines 330..334
                                                miasm/core/objc.py on lines 387..391

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            return False
                                                        return self.name == other.name
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 206..210
                                                miasm/core/objc.py on lines 288..292
                                                miasm/core/objc.py on lines 330..334
                                                miasm/core/objc.py on lines 387..391

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

                                                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 5 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        ret = self.cmp_base(other)
                                                        if ret:
                                                            return False
                                                        return self.name == other.name
                                                Severity: Major
                                                Found in miasm/core/objc.py and 4 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 140..144
                                                miasm/core/objc.py on lines 206..210
                                                miasm/core/objc.py on lines 288..292
                                                miasm/core/objc.py on lines 387..391

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    elif expr.is_op("[]"):
                                                        out = "(%s)[%s]" % (access_str(expr.args[0]), access_str(expr.args[1]))
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 469..470
                                                miasm/core/objc.py on lines 471..472

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    elif expr.is_op("field"):
                                                        out = "(%s).%s" % (access_str(expr.args[0]), access_str(expr.args[1]))
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 471..472
                                                miasm/core/objc.py on lines 473..474

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    elif expr.is_op("->"):
                                                        out = "(%s)->%s" % (access_str(expr.args[0]), access_str(expr.args[1]))
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 1 hr to fix
                                                miasm/core/objc.py on lines 469..470
                                                miasm/core/objc.py on lines 473..474

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        return (super(CGenField, self).__eq__(other) and
                                                                self._ptr == other.ptr)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 50 mins to fix
                                                miasm/core/objc.py on lines 532..534
                                                miasm/core/objc.py on lines 570..572

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        return (super(CGenInt, self).__eq__(other) and
                                                                self._integer == other.integer)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 50 mins to fix
                                                miasm/core/objc.py on lines 570..572
                                                miasm/core/objc.py on lines 761..763

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        return (super(CGenId, self).__eq__(other) and
                                                                self._name == other.name)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 50 mins to fix
                                                miasm/core/objc.py on lines 532..534
                                                miasm/core/objc.py on lines 761..763

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

                                                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 3 locations. Consider refactoring.
                                                Open

                                                    def __eq__(self, other):
                                                        return (self.__class__ == other.__class__ and
                                                                self._ctype == other.ctype)
                                                Severity: Major
                                                Found in miasm/core/objc.py and 2 other locations - About 45 mins to fix
                                                miasm/core/types.py on lines 379..380
                                                miasm/core/types.py on lines 1123..1124

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

                                                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

                                                There are no issues that match your filters.

                                                Category
                                                Status