Showing 9,525 of 13,510 total issues
File HTMLParser.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
File markupbase.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
File fancy_getopt.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""distutils.fancy_getopt
Wrapper around the standard getopt module that provides the following
additional features:
* short and long options are tied together
File markupbase.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
File HTMLParser.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
File fancy_getopt.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""distutils.fancy_getopt
Wrapper around the standard getopt module that provides the following
additional features:
* short and long options are tied together
XMLFilterBase
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class XMLFilterBase(xmlreader.XMLReader):
"""This class is designed to sit between an XMLReader and the
client application's event handlers. By default, it does nothing
but pass requests up to the reader and events on to the handlers
unmodified, but subclasses can override specific methods to modify
ExpatBuilder
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class ExpatBuilder:
"""Document builder that uses Expat to build a ParsedXML.DOM document
instance."""
def __init__(self, options=None):
XMLFilterBase
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class XMLFilterBase(xmlreader.XMLReader):
"""This class is designed to sit between an XMLReader and the
client application's event handlers. By default, it does nothing
but pass requests up to the reader and events on to the handlers
unmodified, but subclasses can override specific methods to modify
ExpatBuilder
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class ExpatBuilder:
"""Document builder that uses Expat to build a ParsedXML.DOM document
instance."""
def __init__(self, options=None):
File logger.py
has 305 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
Method LzmaBenchmark
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public int LzmaBenchmark(Int32 numIterations, UInt32 dictionarySize)
{
if (numIterations <= 0)
return 0;
if (dictionarySize < (1 << 18))
Method LzmaBenchmark
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public int LzmaBenchmark(int numIterations, int dictionarySize) throws Exception
{
if (numIterations <= 0)
return 0;
if (dictionarySize < (1 << 18))
Function GenFeatureFlagPcds
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def GenFeatureFlagPcds(self, Type='', ContainerFile=''):
Pcds = {}
if Type == DataType.TAB_PCDS_FEATURE_FLAG:
Model = MODEL_PCD_FEATURE_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 GetSplitValueList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def GetSplitValueList(String, SplitTag=DataType.TAB_VALUE_SPLIT, MaxSplit= -1):
ValueList = []
Last = 0
Escaped = False
InString = False
- 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 StringToArray
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def StringToArray(String):
if isinstance(String, unicode):
if len(unicode) == 0:
return "{0x00, 0x00}"
return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for C in String])
- 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 IsModuleDefinedInPlatform
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def IsModuleDefinedInPlatform(self, Inf, Arch, InfList):
for Dsc in self.DscDatabase.values():
for LibraryClass in Dsc.Platform.LibraryClasses.LibraryList:
if Inf == LibraryClass.FilePath and Arch in LibraryClass.SupArchList:
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 ValidatePS2
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def ValidatePS2(Package):
#
# Check DistributionPackage -> PackageSurfaceArea -> Modules -> ModuleSurfaceArea
#
XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'Modules', 'ModuleSurfaceArea']
- 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 IsValidCFormatGuid
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def IsValidCFormatGuid(Guid):
#
# Valid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38,
# 0xaf, 0x48, 0xce }}
# Invalid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38,
- 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 GetFiles
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def GetFiles(Root, SkipList=None, FullPath=True):
OriPath = os.path.normpath(Root)
FileList = []
for Root, Dirs, Files in walk(Root):
if SkipList:
- 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"