Showing 1,373 of 3,020 total issues
Function encode
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def encode(self):
self.parent.updown.value = 1
e = self.expr
if not isinstance(e, ExprMem):
return False
- 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 arg2str
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def arg2str(e, pos = None, loc_db=None):
if isinstance(e, ExprId) or isinstance(e, ExprInt):
return str(e)
elif isinstance(e, ExprMem):
addr = e.ptr
- 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 asm_ast_to_expr
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def asm_ast_to_expr(self, arg, loc_db):
if isinstance(arg, AstId):
if isinstance(arg.name, ExprId):
return arg.name
if arg.name in gpregs.str:
- 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 irblock_slice
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def irblock_slice(self, irb, max_line=None):
"""Slice of the dependency nodes on the irblock @irb
@irb: irbloc 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 __repr__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __repr__(self):
rep = ["<%s>" % (self.__class__.__name__)]
if self.resdesc is None:
return "\n".join(rep)
dir_todo = [self.resdesc]
- 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_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)
- 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 get_phi_sources_parent_block
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_phi_sources_parent_block(ircfg, loc_key, sources):
"""
Return a dictionary linking a variable to it's direct parent label
which belong to a path which affects the node.
@loc_key: the starting node
- 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 aggressive_coalesce_block
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def aggressive_coalesce_block(self):
"""Try to coalesce phi var with their pre/post variables"""
ircfg = self.ssa.graph
- 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 isolate_phi_nodes_block
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def isolate_phi_nodes_block(self):
"""
Init structures and virtually insert parallel copy before/after each phi
node
"""
- 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 insert_parallel_copy
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def insert_parallel_copy(self):
"""
Naive Out-of-SSA from CSSA (without coalescing for now)
- Replace Phi
- Create room for parallel copies in Phi's parents
- 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 cannon_list
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def cannon_list(tmp):
"""
Return a cannonizes list of intervals
@tmp: list of (int, 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 resolve_symbol
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def resolve_symbol(blockChains, loc_db, dst_interval=None):
"""Place @blockChains in the @dst_interval"""
log_asmblock.info('resolve_symbol')
if dst_interval is 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 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
- 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 _propagate_sol
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _propagate_sol(self, node, partial_sol, graph, todo, propagator):
"""
Try to extend the current @partial_sol by propagating the solution using
@propagator on @node.
New solutions are added to @todo
- 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 get_ir
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_ir(self, instr):
args = instr.args[:]
args = [arg.replace_expr(float_replace) for arg in args]
args = fix_mem_args_size(instr, *args)
my_ss = None
Function analyse_function
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def analyse_function():
# Get settings
settings = TypePropagationForm()
ret = settings.Execute()
if not ret:
Function ldz
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ldz(rn, rm):
"""LDZ - Count Leading Zeroes
Note: this implementation is readable, yet slow. Each bit are tested
individually, and the results are propagated to other bits.
Consider simplifying this complex logical expression. Open
if (not ((arg1.is_op() and arg1.op.startswith("zeroExt") and
arg2.is_op() and arg2.op.startswith("zeroExt")) or
(arg1.is_op() and arg1.op.startswith("signExt") and
arg2.is_op() and arg2.op.startswith("signExt")))):
return expr
Consider simplifying this complex logical expression. Open
if expr.cond.is_op('-') and len(expr.cond.args) == 1:
expr = ExprCond(expr.cond.args[0], expr.src1, expr.src2)
# a?x:x
elif expr.src1 == expr.src2:
expr = expr.src1
Consider simplifying this complex logical expression. Open
if (isinstance(child, ExprId) or isinstance(child, ExprInt) or
isinstance(child, ExprCompose) or isinstance(child, ExprMem) or
isinstance(child, ExprSlice)):
return False
elif isinstance(child, ExprOp) and not child.is_infix():