cea-sec/miasm

View on GitHub
miasm/jitter/llvmconvert.py

Summary

Maintainability
F
1 wk
Test Coverage

File llvmconvert.py has 1463 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#
#
# Miasm2 Extension:                                                            #
# - Miasm2 IR to LLVM IR                                                       #
# - JiT                                                                        #
Severity: Major
Found in miasm/jitter/llvmconvert.py - About 3 days to fix

    Function add_ir has a Cognitive Complexity of 164 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_ir(self, expr):
            "Add a Miasm2 IR to the last bbl. Return the var created"
    
            if self.main_stream is True and expr in self.expr_cache:
                return self.expr_cache[expr]
    Severity: Minor
    Found in miasm/jitter/llvmconvert.py - About 3 days 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 gen_irblock has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        def gen_irblock(self, instr_attrib, attributes, instr_offsets, irblock):
            """
            Generate the code for an @irblock
            @instr_attrib: an Attributes instance or the instruction to translate
            @attributes: list of Attributes corresponding to irblock assignments
    Severity: Minor
    Found in miasm/jitter/llvmconvert.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

    LLVMFunction has 34 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class LLVMFunction(object):
        """Represent a LLVM function
    
        Implementation note:
        A new module is created each time to avoid cumulative lag (if @new_module)
    Severity: Minor
    Found in miasm/jitter/llvmconvert.py - About 4 hrs to fix

      Function from_asmblock has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def from_asmblock(self, asmblock):
              """Build the function from an asmblock (asm_block instance).
              Prototype : f(i8* jitcpu, i8* vmcpu, i8* vmmngr, i8* status)"""
      
              # Build function signature
      Severity: Minor
      Found in miasm/jitter/llvmconvert.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 gen_jump2dst has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def gen_jump2dst(self, attrib, instr_offsets, dst):
              """Generate the code for a jump to @dst with final check for error
      
              Several cases have to be considered:
               - jump to an offset out of the current ASM BBL (JMP 0x11223344)
      Severity: Minor
      Found in miasm/jitter/llvmconvert.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

      Avoid too many return statements within this function.
      Open

                  return var
      Severity: Major
      Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return ret
        Severity: Major
        Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return ret
          Severity: Major
          Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return arg
            Severity: Major
            Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return ret
              Severity: Major
              Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return ret
                Severity: Major
                Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return ret
                  Severity: Major
                  Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return ret
                    Severity: Major
                    Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return ret
                      Severity: Major
                      Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return ret
                        Severity: Major
                        Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return ret
                          Severity: Major
                          Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return last
                            Severity: Major
                            Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                              return ret
                              Severity: Major
                              Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return ret
                                Severity: Major
                                Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return ret
                                  Severity: Major
                                  Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return ret
                                    Severity: Major
                                    Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return ret
                                      Severity: Major
                                      Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return ret
                                        Severity: Major
                                        Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return last
                                          Severity: Major
                                          Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                            return ret
                                            Severity: Major
                                            Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                              return ret
                                              Severity: Major
                                              Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                            return ret
                                                Severity: Major
                                                Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                                  return self.add_ir(new_expr)
                                                  Severity: Major
                                                  Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                    return ret
                                                    Severity: Major
                                                    Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                      return self.add_ir(new_expr)
                                                      Severity: Major
                                                      Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                        return ret
                                                        Severity: Major
                                                        Found in miasm/jitter/llvmconvert.py - About 30 mins to fix

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

                                                                          for i, arg in enumerate(args):
                                                                              if arg.type.width < fc_ptr.args[i].type.width:
                                                                                  casted_args.append(
                                                                                      builder.zext(
                                                                                          arg,
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 3 hrs to fix
                                                          miasm/jitter/llvmconvert.py on lines 920..929

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

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                          for i, arg in enumerate(args, 1):
                                                                              if arg.type.width < fc_ptr.args[i].type.width:
                                                                                  casted_args.append(
                                                                                      builder.zext(
                                                                                          arg,
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 3 hrs to fix
                                                          miasm/jitter/llvmconvert.py on lines 827..836

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

                                                          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

                                                                          elif expr.size == 64:
                                                                              arg = builder.bitcast(arg, llvm_ir.DoubleType())
                                                                              ret = builder.call(
                                                                                  self.mod.get_global("llvm.%s.f64" % op),
                                                                                  [arg]
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 1 hr to fix
                                                          miasm/jitter/llvmconvert.py on lines 1116..1120

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 45.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                          if expr.size == 32:
                                                                              arg = builder.bitcast(arg, llvm_ir.FloatType())
                                                                              ret = builder.call(
                                                                                  self.mod.get_global("llvm.%s.f32" % op),
                                                                                  [arg]
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 1 hr to fix
                                                          miasm/jitter/llvmconvert.py on lines 1122..1126

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 45.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      fc["bcdadd_cf_%s" % k] = {"ret": LLVMType.IntType(k),
                                                                                                "args": [LLVMType.IntType(k),
                                                                                                         LLVMType.IntType(k)]}
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 1 hr to fix
                                                          miasm/jitter/llvmconvert.py on lines 202..204

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

                                                          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

                                                                      fc["bcdadd_%s" % k] = {"ret": LLVMType.IntType(k),
                                                                                             "args": [LLVMType.IntType(k),
                                                                                                      LLVMType.IntType(k)]}
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 1 hr to fix
                                                          miasm/jitter/llvmconvert.py on lines 205..207

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

                                                          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

                                                                  fc["MEM_WRITE_INT_BN_FROM_PTR"] = {"ret": llvm_ir.VoidType(),
                                                                                                     "args": [
                                                                                                         p8,
                                                                                                         LLVMType.IntType(32),
                                                                                                         LLVMType.IntType(64),
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 1 hr to fix
                                                          miasm/jitter/llvmconvert.py on lines 299..304

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

                                                                  fc["MEM_LOOKUP_INT_BN_TO_PTR"] = {"ret": llvm_ir.VoidType(),
                                                                                                    "args": [
                                                                                                        p8,
                                                                                                        LLVMType.IntType(32),
                                                                                                        LLVMType.IntType(64),
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 1 hr to fix
                                                          miasm/jitter/llvmconvert.py on lines 306..311

                                                          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

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

                                                                          new_expr = ExprCompose(
                                                                              arg,
                                                                              ExprCond(
                                                                                  arg.msb(),
                                                                                  ExprInt(size2mask(add_size), add_size),
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 2 other locations - About 40 mins to fix
                                                          miasm/expression/simplifications_explicit.py on lines 16..21
                                                          miasm/ir/translators/C.py on lines 167..172

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 34.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  self.my_args.append((ExprId("vmcpu", 32),
                                                                                       llvm_ir.PointerType(LLVMType.IntType(8)),
                                                                                       "vmcpu"))
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 3 other locations - About 30 mins to fix
                                                          miasm/jitter/llvmconvert.py on lines 1708..1710
                                                          miasm/jitter/llvmconvert.py on lines 1714..1716
                                                          miasm/jitter/llvmconvert.py on lines 1717..1719

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

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                          if ret_size > expr.size:
                                                                              ret = builder.trunc(ret, LLVMType.IntType(expr.size))
                                                          Severity: Minor
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 30 mins to fix
                                                          miasm/jitter/llvmconvert.py on lines 841..842

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

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                          if ret_size > expr.size:
                                                                              ret = builder.trunc(ret, LLVMType.IntType(expr.size))
                                                          Severity: Minor
                                                          Found in miasm/jitter/llvmconvert.py and 1 other location - About 30 mins to fix
                                                          miasm/jitter/llvmconvert.py on lines 1105..1106

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

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

                                                                  self.my_args.append((ExprId("vmmngr", 32),
                                                                                       llvm_ir.PointerType(LLVMType.IntType(8)),
                                                                                       "vmmngr"))
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 3 other locations - About 30 mins to fix
                                                          miasm/jitter/llvmconvert.py on lines 1708..1710
                                                          miasm/jitter/llvmconvert.py on lines 1711..1713
                                                          miasm/jitter/llvmconvert.py on lines 1717..1719

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

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

                                                                  self.my_args.append((ExprId("jitcpu", 32),
                                                                                       llvm_ir.PointerType(LLVMType.IntType(8)),
                                                                                       "jitcpu"))
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 3 other locations - About 30 mins to fix
                                                          miasm/jitter/llvmconvert.py on lines 1711..1713
                                                          miasm/jitter/llvmconvert.py on lines 1714..1716
                                                          miasm/jitter/llvmconvert.py on lines 1717..1719

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

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

                                                                  self.my_args.append((ExprId("status", 32),
                                                                                       llvm_ir.PointerType(LLVMType.IntType(8)),
                                                                                       "status"))
                                                          Severity: Major
                                                          Found in miasm/jitter/llvmconvert.py and 3 other locations - About 30 mins to fix
                                                          miasm/jitter/llvmconvert.py on lines 1708..1710
                                                          miasm/jitter/llvmconvert.py on lines 1711..1713
                                                          miasm/jitter/llvmconvert.py on lines 1714..1716

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

                                                          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