cea-sec/miasm

View on GitHub
miasm/jitter/jitcore_python.py

Summary

Maintainability
D
1 day
Test Coverage

Function add_block has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
Open

    def add_block(self, asmblock):
        """Create a python function corresponding to an AsmBlock
        @asmblock: AsmBlock
        """

Severity: Minor
Found in miasm/jitter/jitcore_python.py - About 1 day 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 exec_wrapper has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def exec_wrapper(self, loc_key, cpu, _offset_to_jitted_func, _stop_offsets,
Severity: Minor
Found in miasm/jitter/jitcore_python.py - About 35 mins to fix

    Avoid too many return statements within this function.
    Open

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

      Avoid too many return statements within this function.
      Open

                              return int(exec_engine.eval_expr(codegen.delay_slot_dst))
      Severity: Major
      Found in miasm/jitter/jitcore_python.py - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status