FundraiserStatisticsGen/fundstatgen.py
Function pivotDataByYear
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def pivotDataByYear(stats):
"""
Transformation of the statistical data -- grouping reports by date
Returns ((list of years), {report: {date: [year data]}})
- 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 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def main():
# Extract any command line options
parser = OptionParser(usage="usage: %prog [options] <working directory>")
parser.add_option("-c", "--config", dest='configFile', default=None, help='Path to configuration file')
(options, args) = parser.parse_args()
Function createSingleOutFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def createSingleOutFile(stats, firstcols, basefilename, colnames=None):
"""
Creates a single report file from a keyed dict
stats must be a dictionary of something list like; if internally it is a dictionary
- 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 getPerCampaignData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def getPerCampaignData(host, port, username, password, database):
Function getPerYearData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def getPerYearData(host, port, username, password, database):