Showing 9,525 of 13,510 total issues
File decoder.py
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Implementation of JSONDecoder
"""
import re
import sys
import struct
File handlers.py
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Base classes for server/gateway implementations"""
from types import StringType
from util import FileWrapper, guess_scheme, is_hop_by_hop
from headers import Headers
File decoder.py
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Implementation of JSONDecoder
"""
import re
import sys
import struct
File PcdXml.py
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
## @file
# This file is used to parse a PCD file of .PKG file
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
File ExpressionValidate.py
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
## @file
# This file is used to check PCD logical expression
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
InfPcdItem
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class InfPcdItem():
def __init__(self):
self.CName = ''
self.Token = ''
self.TokenSpaceGuidCName = ''
PackageObject
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class PackageObject(IdentificationObject, CommonHeaderObject):
def __init__(self):
IdentificationObject.__init__(self)
CommonHeaderObject.__init__(self)
#
BitVec
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class BitVec:
def __init__(self, *params):
self._data = 0L
self._len = 0
ArgumentParser
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class ArgumentParser(_AttributeHolder, _ActionsContainer):
"""Object for parsing command line strings into Python objects.
Keyword Arguments:
- prog -- The name of the program (default: sys.argv[0])
GenericParser
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class GenericParser:
#
# An Earley parser, as per J. Earley, "An Efficient Context-Free
# Parsing Algorithm", CACM 13(2), pp. 94-102. Also J. C. Earley,
# "An Efficient Context-Free Parsing Algorithm", Ph.D. thesis,
ArgumentParser
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class ArgumentParser(_AttributeHolder, _ActionsContainer):
"""Object for parsing command line strings into Python objects.
Keyword Arguments:
- prog -- The name of the program (default: sys.argv[0])
Function GenComponent
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def GenComponent(self, Item, ContainerFile, LineNo= -1):
(InfFilename, ExecFilename) = GetExec(Item[0])
LibraryClasses = Item[1]
BuildOptions = Item[2]
Pcds = Item[3]
- 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 GenPcds
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def GenPcds(self, Type='', ContainerFile=''):
Pcds = {}
if Type == DataType.TAB_PCDS_PATCHABLE_IN_MODULE:
Model = MODEL_PCD_PATCHABLE_IN_MODULE
elif Type == DataType.TAB_PCDS_FIXED_AT_BUILD:
- 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 __GetFileOpts
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def __GetFileOpts(self, FfsFileObj):
if self.__GetNextToken():
Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
if Pattern.match(self.__Token):
- 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 CleanString
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def CleanString(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False, BuildOption=False):
#
# remove whitespace
#
Line = Line.strip();
- 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 ConvertDictionaryToTextFile
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
try:
F = open(FileName,'r')
Lines = []
Lines = F.readlines()
- 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 FromXml
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def FromXml(self, Item, Key, IsStandAlongModule=False):
IsBinaryModule = XmlAttribute(Item, 'BinaryModule')
#
# Header
#
- 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 ParseDecPcdGenericComment
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def ParseDecPcdGenericComment (GenericComment, ContainerFile):
HelpStr = ''
PcdErr = None
for (CommentLine, LineNum) in GenericComment:
- 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 InfAsBuiltLibraryParser
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def InfAsBuiltLibraryParser(self, SectionString, InfSectionObject, FileName):
LibraryList = []
LibInsFlag = False
for Line in SectionString:
LineContent = Line[0]
- 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 _SectionHeaderParser
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _SectionHeaderParser(self):
self._Scope = []
self._SectionName = ''
ArchList = set()
for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
- 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"