Showing 214 of 421 total issues
File util.py
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import functools
import string
from six import iteritems, integer_types, PY2
MachineConfig
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MachineConfig(ConfigParser):
"""
Contains configuration of the whole VM, and provides methods for parsing,
inspection and extending this configuration.
"""
Machine
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Machine(ISnapshotable, IMachineWorker):
"""
Virtual machine itself.
"""
Function assemble_operands
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def assemble_operands(cls, ctx, inst, operands):
from ..asm.ast import RegisterOperand, ReferenceOperand
ctx.encode(inst, 'reg1', 5, operands[0].operand)
- 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 main
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def main():
import optparse
from . import add_common_options, parse_options
parser = optparse.OptionParser()
- 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 jit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def jit(core, inst):
regset = core.registers
err = DivideByZeroError(core = core)
if inst.immediate_flag == 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 execute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def execute(core, inst):
regset = core.registers
r = regset[inst.reg1]
v = RI_VAL(core, inst, 'reg2')
- 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 pass2
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def pass2(self):
assert self.sections_pass1 is not None
D = self.DEBUG
- 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 visit_Expr
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def visit_Expr(self, node):
self.generic_visit(node)
if type(node.value) != ast.Call:
return 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 evaluate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def evaluate(core, inst):
# genuine flags
if inst.flag in _COND.GFLAGS and inst.value == getattr(core, _COND.FLAGS[inst.flag]):
return True
- 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 run
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
self.machine.DEBUG('%s.run: fds=%s', self.__class__.__name__, self.fds.keys())
try:
events = self.poll.poll(0.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 process_config_options
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process_config_options(logger, options, config_file = None, set_options = None, add_options = None, enable_devices = None, disable_devices = None):
"""
Load VM config file, and apply all necessary changes, as requested by command-line options.
:param logging.Logger logger: ``Logger`` instance to use for logging.
- 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 link_files
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def link_files(info, files_in, file_out):
D = get_logger().debug
fs_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 read_u16
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_u16(self, offset):
self.DEBUG('%s.read_u16: offset=%s', self.__class__.__name__, offset)
if offset == SimpleVGAPorts.CONTROL:
return 0x0000
- 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 __init__
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, coreid, cpu, memory_controller):
super(CPUCore, self).__init__()
config = cpu.machine.config
Function __check_chain
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def __check_chain(self, stage, chain, clean_triggered = False, *args, **kwargs):
D = self.core.DEBUG
D('__check_chain: stage=%s, chain=%s, clean_triggered=%s', stage, chain, clean_triggered)
- 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 setup_hdt
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def setup_hdt(self):
"""
Initialize memory area containing :ref:`HDT`.
If VM config file specifies ``HDT`` image file, it is loaded, otherwise HDT
- 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 disassemble_mnemonic
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def disassemble_mnemonic(inst):
if inst.flag in _COND.GFLAGS:
return 'b%s%s' % ('n' if inst.value == 0 else '', _COND.MNEMONICS[inst.flag])
else:
- 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 main
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def main():
parser = optparse.OptionParser()
add_common_options(parser)
parser.add_option('-i', dest = 'file_in', action = 'append', default = [], help = 'File to inspect')
- 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 do_log_cpu_core_state
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def do_log_cpu_core_state(core, logger = None, disassemble = True, inst_set = None):
"""
Log state of a CPU core. Content of its registers, and other interesting or
useful internal variables are logged.
- 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"