Esri/solutions-geoprocessing-toolbox

View on GitHub

Showing 110 of 259 total issues

Function rotateAndScale has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def rotateAndScale(angle, scaleFactor, x0, y0, x1, y1) : 
Severity: Minor
Found in military_features/scripts/GeometryConverter.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if not finalTag in line :  # ex. "</messages>"
                                temporaryFile.write(line)
                            else :
                                finalTagFound = True
                        else :
    Severity: Major
    Found in military_features/scripts/WriteMessageFromFeature.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if len(ring) > 0:
                                  rings.add(ring)
                                  ring.removeAll()
                      # we have our last ring, add it
                      rings.add(ring)
      Severity: Major
      Found in clearing_operations/scripts/GRGUtilities.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if fieldName in fieldNameList:
                                    row.setValue(fieldName, fieldValue)
                                
        Severity: Major
        Found in geonames/scripts/LoadGeonames.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if i > -1:
                                  # Extract characters before "("
                                  adm1Class = adm1ClassAll[:i].strip()
                                  # Extract characters after ")"
                                  adm1Type =  adm1ClassAll[i:].strip()
          Severity: Major
          Found in geonames/scripts/LoadGeonames.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for domainRow in domainRows:
                                    echelonString = domainRow.getValue(DESCRIPTION_FIELD_NAME)
                                    echelonString = echelonString.upper()
            
            
            Severity: Major
            Found in military_features/scripts/CalcSIDCField.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if labelStyle != 'Numeric':
                                          labelNumber = 0
                                      else:
                                          labelNumber = (verticalCells - (verticalCount + 1)) * horizontalCells
                                  elif labelStartPos == "Upper-Right":
              Severity: Major
              Found in clearing_operations/scripts/GRGUtilities.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if attributes.has_key(DictionaryConstants.Tag_Id) : 
                                            attributes[DictionaryConstants.Tag_Id] = attributes[DictionaryConstants.Tag_Id] + "_2"
                                repeatCount = repeatCount + 1
                Severity: Major
                Found in military_features/scripts/WriteFeatureFromMessage.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if orientation > 0.0 :
                                              attributes[DictionaryConstants.Tag_Orientation] = orientation
                                                                      
                  Severity: Major
                  Found in military_features/scripts/GeometryConverter.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if countryName is None:
                                            row.setNull("COUNTRYNAME1")
                                        else:
                                            row.setValue("COUNTRYNAME1", countryName)
                                        
                    Severity: Major
                    Found in geonames/scripts/LoadGeonames.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if labelStyle != 'Numeric':
                                                  labelNumber = horizontalCells + 1
                                              else:
                                                  labelNumber = ((verticalCount + 1) * horizontalCells) + 1
                                          elif labelStartPos == "Lower-Left":
                      Severity: Major
                      Found in clearing_operations/scripts/GRGUtilities.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if not (field.name in DictionaryConstants.MILFEATURES_FIELD_EXCLUDE_LIST) :
                                                        lowerFieldName = field.name.lower()
                                                        # we don't the case of the attribute so have to search
                                                        for key in attributes.keys() :                                     
                                                            lowerKey = key.lower() 
                        Severity: Major
                        Found in military_features/scripts/WriteFeatureFromMessage.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if labelStyle != 'Numeric':
                                                      labelNumber = 0
                                                      
                          Severity: Major
                          Found in clearing_operations/scripts/GRGUtilities.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if labelStyle != 'Numeric':
                                                        labelNumber = horizontalCells + 1
                                                elif labelStartPos == "Lower-Right":
                            Severity: Major
                            Found in clearing_operations/scripts/GRGUtilities.py - About 45 mins to fix

                              Function rotate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def rotate(angle, x0, y0, x1, y1) : # rotate (x1, y1) about (x0, y0) by angle (degrees)
                              Severity: Minor
                              Found in military_features/scripts/GeometryConverter.py - About 35 mins to fix

                                Function scale has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def scale(scaleFactor, x0, y0, x1, y1) : # Vector V0(x0,y0)->V1(x1,y1)
                                Severity: Minor
                                Found in military_features/scripts/GeometryConverter.py - About 35 mins to fix

                                  Function symbolIdToGeometryType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def symbolIdToGeometryType(self, symbolId) :
                                  
                                          sqliteConn = None
                                          sqliteCursor = None
                                          symboldictionary = self.getDictionaryPath() 
                                  Severity: Minor
                                  Found in military_features/scripts/SymbolDictionary.py - About 35 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 isCorrectShapeTypeForFeature has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def isCorrectShapeTypeForFeature(geoType, shapeType) :
                                      if (geoType == POINT_STRING) and (shapeType == "Point") : 
                                          return True
                                      elif (geoType == LINE_STRING) and (shapeType == "Polyline") : 
                                          return True
                                  Severity: Minor
                                  Found in military_features/scripts/DictionaryConstants.py - About 35 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 _findSet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _findSet(zoneNum):
                                    '''
                                    There are six unique sets, corresponding to individual grid numbers in
                                    sets 1-6, 7-12, 13-18, etc. Set 1 is the same as sets 7, 13, ..;
                                    Set 2 is the same as sets 8, 14, ..
                                  Severity: Minor
                                  Found in clearing_operations/scripts/RefGrid.py - About 35 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 symbolIdToGeometryConversionType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def symbolIdToGeometryConversionType(self, symbolId) : 
                                  
                                          sqliteConn = None
                                          sqliteCursor = None
                                          symboldictionary = self.getDictionaryPath() 
                                  Severity: Minor
                                  Found in military_features/scripts/SymbolDictionary.py - About 35 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language