cea-sec/miasm

View on GitHub
example/expression/graph_dataflow.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function intra_block_flow_symb has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def intra_block_flow_symb(lifter, _, flow_graph, irblock, in_nodes, out_nodes):
    symbols_init = lifter.arch.regs.regs_init.copy()
    sb = SymbolicExecutionEngine(lifter, symbols_init)
    sb.eval_updt_irblock(irblock)
    print('*' * 40)
Severity: Minor
Found in example/expression/graph_dataflow.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 intra_block_flow_symb has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def intra_block_flow_symb(lifter, _, flow_graph, irblock, in_nodes, out_nodes):
Severity: Minor
Found in example/expression/graph_dataflow.py - About 45 mins to fix

    Function gen_block_data_flow_graph has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def gen_block_data_flow_graph(lifter, ircfg, ad, block_flow_cb):
        for irblock in viewvalues(ircfg.blocks):
            print(irblock)
    
        deadrm(ircfg)
    Severity: Minor
    Found in example/expression/graph_dataflow.py - About 35 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

    There are no issues that match your filters.

    Category
    Status