Showing 1,373 of 3,020 total issues
File arch.py
has 1056 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Toshiba MeP-c4 - miasm architecture definition
# Guillaume Valadon <guillaume@valadon.net>
from builtins import range
from miasm.core.cpu import *
Function parse_txt
has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring. Open
def parse_txt(mnemo, attrib, txt, loc_db):
"""Parse an assembly listing. Returns an AsmCfg instance
@mnemo: architecture used
@attrib: architecture attribute
- 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 symbexec.py
has 913 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import print_function
from builtins import range
import logging
try:
from collections.abc import MutableMapping
Function from_ExprOp
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
def from_ExprOp(self, expr):
if len(expr.args) == 1:
if expr.op == 'parity':
arg = expr.args[0]
out = self.from_expr(arg)
- 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 graph.py
has 864 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import defaultdict, namedtuple
from future.utils import viewitems, viewvalues
import re
File ir.py
has 843 lines of code (exceeds 250 allowed). Consider refactoring. Open
#-*- coding:utf-8 -*-
#
# Copyright (C) 2013 Fabrice Desclaux
#
Function eval_assignblock
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
def eval_assignblock(self, assignblock):
"""
Evaluate the @assignblock on the current state
@assignblock: AssignBlock 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
File sem.py
has 793 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import print_function
from builtins import range
import miasm.expression.expression as expr
from miasm.ir.ir import AssignBlock, Lifter, IRBlock
File arch.py
has 789 lines of code (exceeds 250 allowed). Consider refactoring. Open
#-*- coding:utf-8 -*-
from __future__ import print_function
from builtins import range
File sandbox.py
has 772 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import print_function
from builtins import range
import os
import logging
File environment.py
has 745 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import print_function
from collections import namedtuple
import functools
import logging
import os
File syscall.py
has 739 lines of code (exceeds 250 allowed). Consider refactoring. Open
from builtins import range
import fcntl
import functools
import logging
import struct
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
"""
- 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 kernel32_CreateFile
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def kernel32_CreateFile(jitter, funcname, get_str):
ret_ad, args = jitter.func_args_stdcall(["lpfilename", "access",
"dwsharedmode",
"lpsecurityattr",
"dwcreationdisposition",
- 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 arch.py
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
from builtins import range
import logging
from pyparsing import *
from miasm.expression.expression import *
Function match_expr
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
def match_expr(expr, pattern, tks, result=None):
"""Try to match the @pattern expression with the pattern @expr with @tks jokers.
Result is output dictionary with matching joker values.
@expr : Expr pattern
@pattern : Targeted Expr to match
- 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 elf_init.py
has 670 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/env python
from __future__ import print_function
from builtins import range
import logging
File arch.py
has 663 lines of code (exceeds 250 allowed). Consider refactoring. Open
#-*- coding:utf-8 -*-
import logging
from collections import defaultdict
File pe.py
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
from builtins import map
import os
import struct
import logging
from collections import defaultdict
File sem.py
has 639 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Toshiba MeP-c4 - miasm instructions side effects
# Guillaume Valadon <guillaume@valadon.net>
from miasm.core.sembuilder import SemBuilder
from miasm.ir.ir import Lifter