deparkes/OOMMFTools

View on GitHub

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 = {}
Severity: Minor
Found in oommftools/core/odtchomp.py - About 6 hrs to fix

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)
Severity: Major
Found in oommftools/user_interfaces/gui/oommfconvert.py - About 4 hrs to fix

    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.
    Severity: Minor
    Found in oommftools/core/oommfdecode.py - About 3 hrs to fix

    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 = " "
    
    
    Severity: Major
    Found in oommftools/user_interfaces/gui/odtchomp.py - About 3 hrs to fix

      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
      Severity: Minor
      Found in oommftools/user_interfaces/gui/oommfconvert.py - About 3 hrs to fix

        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
        Severity: Minor
        Found in oommftools/user_interfaces/gui/odtchomp.py - About 2 hrs to fix

          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
          Severity: Minor
          Found in oommftools/core/odtchomp.py - About 2 hrs to fix

          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(
          Severity: Minor
          Found in oommftools/user_interfaces/cli/main.py - About 1 hr to fix

          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:
          Severity: Minor
          Found in oommftools/core/oommfdecode.py - About 1 hr to fix

          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())
          Severity: Minor
          Found in scripts/make-release.py - About 1 hr to fix

          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:
          Severity: Minor
          Found in oommftools/core/oommfconvert.py - About 1 hr to fix

          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)
          Severity: Minor
          Found in oommftools/user_interfaces/gui/oommfdecode.py - About 1 hr to fix

            Function createTempImagesForMovie has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def createTempImagesForMovie(targetList, moviepath, framedupes, maxdigits, tclCall, OOMMFPath, confpath, stdinRedirect, removeImages=False):
            Severity: Major
            Found in oommftools/core/oommfconvert.py - About 1 hr to fix

              Function doMovies has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def doMovies(targetList, stdinRedirect, config_parent, movieCodec, movieFPS, tclCall, OOMMFPath, doImages, codecs):
              Severity: Major
              Found in oommftools/core/oommfconvert.py - About 1 hr to fix

                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!
                Severity: Minor
                Found in oommftools/user_interfaces/gui/oommfconvert.py - About 1 hr to fix

                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
                    """
                Severity: Minor
                Found in oommftools/core/oommfdecode.py - About 1 hr to fix

                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"])):
                Severity: Minor
                Found in oommftools/core/oommfdecode.py - About 1 hr to fix

                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
                Severity: Minor
                Found in oommftools/user_interfaces/gui/main.py - About 1 hr to fix

                  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
                  Severity: Minor
                  Found in oommftools/user_interfaces/gui/oommfdecode.py - About 55 mins to fix

                  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'):
                  Severity: Major
                  Found in oommftools/core/oommfconvert.py - About 50 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language