Showing 32 of 74 total issues
Function chomp
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def chomp(odt, parent=None):
"""
"""
retHeaders = []
retDict = {}
- 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 __init__
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, manager=None):
wx.Frame.__init__(self, manager, -1, " ".join([NAME, VERSION]), size=(700,700))
BigFont = wx.Font(16, wx.FONTFAMILY_DEFAULT, style=wx.NORMAL, weight=wx.FONTWEIGHT_BOLD)
TinyFont = wx.Font(8, wx.FONTFAMILY_DEFAULT, style=wx.NORMAL, weight=wx.FONTWEIGHT_NORMAL)
Function unpackFile
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def unpackFile(filename):
"""
"""
with open(filename, 'rb') as f:
headers = {} #I know valuemultiplier isn't always present. This is checked later.
- 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 __init__
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, manager=None):
wx.Frame.__init__(self, None, -1, "ODT Chomper 0.9", size=(900, 500))
self.watching = []
self.delim = " "
File oommfconvert.py
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
OOMMFConvert
Copyright (C) 2010 Mark Mascaro
This program is free software; you can redistribute it and/or
File odtchomp.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
ODTChomp
Copyright (C) 2010 Mark Mascaro
This program is free software; you can redistribute it and/or
Function namepolish
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def namepolish(name, uniquenessCheck):
"""Uniquely identify quantity fields.
This is pretty ugly, but the key point is this: it filters
down to the minimum amount of information necessary to uniquely identify a quantity
- 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 cli_main
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def cli_main():
# Create the parser
main_parser = argparse.ArgumentParser(prog='OOMMFTools',
description='A command line interface to OOMMFTools')
main_parser.add_argument(
- 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 sortBySimTime
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def sortBySimTime(extra, arrays):
# We do some enumeration later on that needs 'arrays'
# to be an iterable.
if len(arrays) < 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
Function parse_changelog
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse_changelog():
with open('CHANGES.rst') as f:
lineiter = iter(f)
for line in lineiter:
match = re.search('^Version\s+(.*)', 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 replaceConfigLines
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def replaceConfigLines(oldconflines, newMax, percentMagnitude, checkVectors):
newconf = []
for line in oldconflines:
# Only one data point for line. Let's deal with our cases.
if "misc,datascale" in line and checkVectors:
- 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 __init__
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, manager=None):
wx.Frame.__init__(self, None, -1, " ".join([NAME, VERSION]), size=(340, 400))
BigFont = wx.Font(16, wx.FONTFAMILY_DEFAULT, style=wx.NORMAL, weight=wx.FONTWEIGHT_BOLD)
Function createTempImagesForMovie
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def createTempImagesForMovie(targetList, moviepath, framedupes, maxdigits, tclCall, OOMMFPath, confpath, stdinRedirect, removeImages=False):
Function doMovies
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def doMovies(targetList, stdinRedirect, config_parent, movieCodec, movieFPS, tclCall, OOMMFPath, doImages, codecs):
Function OnDropFiles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def OnDropFiles(self, x, y, filenames):
#Find OOMMF, then a config, then files
oommf = filterOnExtensions(["tcl"], filenames)
if oommf:
#What did you DO? Only the last one counts!
- 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 slowlyPainfullyMaximize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def slowlyPainfullyMaximize(filenames):
"""
This is a special utility function used by OOMMFConvert to find the single largest-magnitude
vector in a set of vector files
"""
- 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 _binaryDecode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _binaryDecode(filehandle, chunksize, decoder, targetarray, headers, extraCaptures):
"""
"""
valm = headers.get("valuemultiplier", 1)
for k in range(int(headers["znodes"])):
- 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 __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self):
wx.Frame.__init__(self, None, -1, "OOMMFTools", size=(400, 200))
self.oommfconvert = None
self.oommfdecode = None
Function gatherData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gatherData(self, data, headers, extraData):
"""
"""
global LASTPATH
#Outputs are array, headers, filenam
- 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 makeMovieFromImages
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def makeMovieFromImages(moviePath, pathTo, maxDigits, movieCodec, stdinRedirect, codecs, mode='advanced'):