Showing 110 of 259 total issues
Function geometrytoControlPoints
has a Cognitive Complexity of 147 (exceeds 5 allowed). Consider refactoring. Open
def geometrytoControlPoints(self, sic, control_points, attributes) :
if (sic is None) or (control_points is None) :
return None, DictionaryConstants.CONVERSION_ERROR_VALIDATION
- 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 writeMessageFile
has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring. Open
def writeMessageFile() :
global DEBUG_GEOMETRY_CONVERSION, appendFile, foundEmptySIDC, FORCE_UNIQUE_IDs
try :
- 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 controlPointsToGeometry
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
def controlPointsToGeometry(self, sic, control_points, attributes) :
inPoints = control_points.split(';')
outPoints = None
- 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 writeFeaturesFromMessageFile
has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring. Open
def writeFeaturesFromMessageFile() :
foundEmptyRuleId = False # used to detect if we can not set a RuleID for any rows
# Get the input message file
- 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
File GeometryConverter.py
has 817 lines of code (exceeds 250 allowed). Consider refactoring. Open
#----------------------------------------------------------------------------------
# Copyright 2013 Esri
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
File GRGUtilities.py
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
'''
------------------------------------------------------------------------------
Copyright 2017 Esri
Licensed under the Apache License, Version 2.0 (the "License");
Function GRGFromArea
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
def GRGFromArea(AOI,
cellWidth,
cellHeight,
cellUnits,
labelStartPos,
- 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
File RefGrid.py
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
'''
RefGrid.py
'''
import re
Function NumberFeatures
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def NumberFeatures(self,
areaToNumber,
pointFeatures,
numberingField,
outputFeatureClass):
- 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 RotateFeatureClass
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def RotateFeatureClass(inputFC, outputFC,
angle=0, pivot_point=None):
"""Rotate Feature Class
inputFC Input features
- 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
File GRGTools.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
'''
------------------------------------------------------------------------------
Copyright 2017 Esri
Licensed under the Apache License, Version 2.0 (the "License");
Function GRGFromPoint
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def GRGFromPoint(starting_point,
horizontal_cells,
vertical_cells,
cell_width,
cell_height,
- 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 SymbolNametoSymbolIDExt
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def SymbolNametoSymbolIDExt(self, symbolName, echelonString, affiliation, expectedGeometry) :
# Attempts to handle the many name cases that show up in Military Features
# A straight Dictionary Name to SIDC case should always work, but the names
# don't always show up in that form, use SymbolNametoSymbolID for simple case
- 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 _ZonesDictionary
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def _ZonesDictionary():
'''
The zonesDictionary object has 1197 unique keys (one for eqch MGRS grid zone).
Rather than load it through a single, large json text file, we build it here programmatically, one time, on the client
'''
- 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 Build
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def Build(self, out_features):
'''
'''
def _createFC(out_feature_path, geometry_type, spatial_reference):
- 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 _handle100kGrids
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def _handle100kGrids(args, AOI):
'''
Creates 100K meter grids
'''
zonePolygon = args['polygon']
- 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
File SymbolDictionary.py
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
#----------------------------------------------------------------------------------
# Copyright 2013 Esri
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
SymbolDictionary
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class SymbolDictionary(object):
"""
Lookup methods & helpers for mappings between SIDC, Name, GeometryType, etc.
Generally just does a straight lookup of the dictionary data file with
some attempts to correct common lookup errors (ex. not including "H" when
Function CalculateSunPosition
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def CalculateSunPosition(date, observerPoint):
if debug == True:
arcpy.AddMessage("Determining sun position for date: " + str(date))
- 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
Consider simplifying this complex logical expression. Open
if (ch == 'F') or (ch == 'H') or (ch == 'U') or (ch == 'N') :
return ch
elif (ch == 'M') or (ch == 'A') or (ch == 'D') or (ch == 'J') or (ch == 'K') :
return 'F'
elif (ch == 'S') :