Showing 1,373 of 3,019 total issues
CGen
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class CGen(object):
"""
Helper to generate C code for a given AsmBlock
"""
Function simp_compose
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def simp_compose(e_s, expr):
"Commons simplification on ExprCompose"
args = merge_sliceto_slice(expr)
out = []
# compose of compose
- Read upRead up
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 create_implicit_flow
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def create_implicit_flow(lifter, flow_graph, irb_in_nodes, irb_out_nodes):
# first fix IN/OUT
# If a son read a node which in not in OUT, add it
todo = set(lifter.blocks.keys())
- Read upRead up
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
File outofssa.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
from future.utils import viewitems, viewvalues
from miasm.expression.expression import ExprId
from miasm.ir.ir import IRBlock, AssignBlock
from miasm.analysis.ssa import get_phi_sources_parent_block, \
Function get_mem_access
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_mem_access(mem):
updt = None
if isinstance(mem, ExprOp):
if mem.op == 'preinc':
if len(mem.args) == 1:
- Read upRead up
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 mn_do_load
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def mn_do_load(ir, instr, arg1, arg2, arg3=None):
assert instr.name[0] == 'L'
ret = []
- Read upRead up
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 set_rva
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def set_rva(self, rva, size=None):
self.parent_head.NThdr.optentries[DIRECTORY_ENTRY_IMPORT].rva = rva
rva_size = self.parent_head._wsize // 8
if not size:
self.parent_head.NThdr.optentries[
- Read upRead up
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 expr_range
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def expr_range(expr):
"""Return a ModularIntervals containing the range of possible values of
@expr"""
max_bound = (1 << expr.size) - 1
if expr.is_int():
- Read upRead up
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 vm2pe
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def vm2pe(myjit, fname, libs=None, e_orig=None,
min_addr=None, max_addr=None,
min_section_offset=0x1000, img_base=None,
added_funcs=None, **kwargs):
if e_orig:
- Read upRead up
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 apply_splitting
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def apply_splitting(self, blocks):
"""Consider @blocks' bto destinations and split block in @blocks if one
of these destinations jumps in the middle of this block. In order to
work, they must be only one block in @self per loc_key in
- Read upRead up
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 difference
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def difference(self, other):
"""
Return the difference of intervals
@other: interval instance
"""
- Read upRead up
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 guess_blocks_size
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def guess_blocks_size(self, mnemo):
"""Asm and compute max block size
Add a 'size' and 'max_size' attribute on each block
@mnemo: metamn instance"""
for block in self.blocks:
- Read upRead up
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
- Read upRead up
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 asmblock_final
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def asmblock_final(mnemo, asmcfg, blockChains, conservative=False):
"""Resolve and assemble @blockChains until fixed point is
reached"""
log_asmblock.debug("asmbloc_final")
- Read upRead up
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 emul_symb
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def emul_symb(lifter, ircfg, mdis, states_todo, states_done):
while states_todo:
addr, symbols, conds = states_todo.pop()
print('*' * 40, "addr", addr, '*' * 40)
if (addr, symbols, conds) in states_done:
- Read upRead up
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_prefix
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def gen_prefix(self):
v = b""
rex = 0x40
if self.g1.value is None:
self.g1.value = 0
- Read upRead up
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 update_phi_with_deleted_edges
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def update_phi_with_deleted_edges(ircfg, edges_to_del):
"""
Update phi which have a source present in @edges_to_del
@ssa: IRCFG instance in ssa form
@edges_to_del: edges to delete
- Read upRead up
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 add_block
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def add_block(self, block):
"""Add a block to JiT and JiT it.
@block: block to jit
"""
block_hash = self.hash_block(block)
- Read upRead up
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 apply_reloc_x86
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def apply_reloc_x86(elf, vm, section, base_addr, loc_db):
"""Apply relocation for x86 ELF contained in the section @section
@elf: miasm.loader's ELF instance
@vm: VmMngr instance
@section: elf's section containing relocation to perform
- Read upRead up
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 resolve_args_with_symbols
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def resolve_args_with_symbols(self, loc_db):
args_out = []
for expr in self.args:
# try to resolve symbols using loc_db (0 for default value)
loc_keys = m2_expr.get_expr_locs(expr)
- Read upRead up
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"