Showing 214 of 421 total issues
File instructions.py
has 2413 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ctypes
import enum
import logging
import sys
Function jit
has a Cognitive Complexity of 198 (exceeds 5 allowed). Consider refactoring. Open
def jit(core, inst):
core.DEBUG('JIT: %s', inst)
regset = core.registers
ip = Registers.IP.value
- 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 118 (exceeds 5 allowed). Consider refactoring. Open
def jit(core, inst):
regset = core.registers
reg1 = inst.reg1
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
File __init__.py
has 905 lines of code (exceeds 250 allowed). Consider refactoring. Open
import functools
import sys
from six import iterkeys, itervalues, iteritems
from six.moves import range
Function resolve_relocations
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def resolve_relocations(info, f_out, f_ins):
logger, D = get_logger(), get_logger().debug
D('')
D('----- * ----- * ----- * ----- * -----')
- 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 __init__.py
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
from six import iteritems, itervalues
from six.moves import range
from ..interfaces import ISnapshotable
from ..errors import AccessViolationError, InvalidResourceError
File math_copro.py
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Stack-based coprocessor, providing several arithmetic operations with "long"
numbers.
Coprocessor's instructions operates on a stack of (by default) 8 slots.
File __init__.py
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import ctypes
import functools
import os.path
import subprocess
File ld.py
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ast
import collections
import logging
import os
import re
File parser.py
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ply.yacc
from .lexer import tokens # NOQA
from .ast import LabelNode, GlobalDirectiveNode, FileDirectiveNode, SectionDirectiveNode, DataSectionDirectiveNode, TextSectionDirectiveNode, SetDirectiveNode
from .ast import StringNode, AsciiNode, SpaceNode, AlignNode, ByteNode, ShortNode, WordNode, InstructionNode, ExpressionNode
Function jit
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def jit(core, inst):
regset = core.registers
if inst.immediate_flag == 0:
reg1, reg2 = inst.reg1, 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
File machine.py
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
:py:class:`ducky.machine.Machine` is *the* virtual machine. Each instance
represents self-contained virtual machine, with all its devices, memory, CPUs
and other necessary properties.
"""
CPUCore
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class CPUCore(ISnapshotable, IMachineWorker):
"""
This class represents the main workhorse, one of CPU cores. Reads
instructions, executes them, has registers, caches, handles interrupts,
...
Function save_object_file
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def save_object_file(logger, sections, file_out, options):
logger = get_logger()
D = logger.debug
if os.path.exists(file_out) and not options.force:
- 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 pass1
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def pass1(self):
"""
Pass #1 transforms list of AST nodes into a multiple lists of Slots,
grouped by sections. It preserves necessary information for later
resolution of slots referencing each other. Also, list of known
- 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 show_symbols
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def show_symbols(options, f):
I = get_logger().info
def to_ascii(buff):
ret = ['' for _ in range(0, len(buff))]
- 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 show_disassemble
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def show_disassemble(f):
logger, I = get_logger(), get_logger().info
I('=== Disassemble ==')
I('')
- 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 vm.py
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
import six.moves
import urllib
if not hasattr(urllib, 'parse'):
urllib.parse = six.moves.urllib.parse
File binary.py
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import enum
from six import itervalues, PY2
from six.moves import range
File svga.py
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
SimpleVGA is very basic implementation of VGA-like device, with text
and graphic modes.
"""