Showing 9,525 of 13,510 total issues
Function close
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def close(self):
"""Close the file, and for mode "w" and "a" write the ending
records."""
if self.fp is None:
return
- 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 computeRollover
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def computeRollover(self, currentTime):
"""
Work out the rollover time based on the specified time.
"""
result = currentTime + self.interval
- 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 findsource
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def findsource(object):
"""Return the entire source file and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of all the lines
- 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 _make_zipfile
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
"""Create a zip file from all the files under 'base_dir'.
The output zip file will be named 'base_name' + ".zip". Uses either the
"zipfile" Python module (if available) or the InfoZIP "zip" utility
- 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 LzmaBench.java
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
package SevenZip;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
File DecParserUnitTest.py
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
## @file
# This file contain unit test for DecParser
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
Checker
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Checker:
checkext = CHECKEXT
verbose = VERBOSE
maxpage = MAXPAGE
RExec
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class RExec(ihooks._Verbose):
"""Basic restricted execution framework.
Code executed in this restricted environment will only have access to
modules and functions that are deemed safe; you can subclass RExec to
Aifc_write
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Aifc_write:
# Variables used in this class:
#
# These variables are user settable through appropriate methods
# of this class:
Fraction
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Fraction(Rational):
"""This class implements rational numbers.
In the two-argument form of the constructor, Fraction(8, 6) will
produce a rational number equivalent to 4/3. Both arguments must
OsHelper
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class OsHelper:
def __init__(self):
self.helper = None
self.loadHelpers()
#print "Operating System: %s %s %s %s" % (self.os_system, self.os_release, self.os_version, self.os_machine)
RExec
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class RExec(ihooks._Verbose):
"""Basic restricted execution framework.
Code executed in this restricted environment will only have access to
modules and functions that are deemed safe; you can subclass RExec to
Aifc_write
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Aifc_write:
# Variables used in this class:
#
# These variables are user settable through appropriate methods
# of this class:
Fraction
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Fraction(Rational):
"""This class implements rational numbers.
In the two-argument form of the constructor, Fraction(8, 6) will
produce a rational number equivalent to 4/3. Both arguments must
File ParserValidate.py
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
## @file ParserValidate.py
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
File ntpath.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
File cmd.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
File xmlout.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/local/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2014, Intel Corporation
#
#This program is free software; you can redistribute it and/or
File cmd.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
Function Instantiate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def Instantiate(self, PlaceHolderValues):
RepeatTime = -1
RepeatPlaceHolders = {}
NonRepeatPlaceHolders = {}
- 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"