Showing 10 of 30 total issues
Function updateTextElements
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def updateTextElements(self, recipe):
"""
Updates Text Elements in Marginalia
"""
for elm in arcpy.mapping.ListLayoutElements(self.mxd, "TEXT_ELEMENT"):
- 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 map_chef.py
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import arcpy
import logging
import re
from datetime import datetime
Function main
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def main(args):
args = parser.parse_args()
layerDirectory = args.layerDirectory
# r=root, d=directories, f = 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 _export_atlas
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _export_atlas(self, recipe_with_atlas, arc_mxd, export_dir):
"""
Exports each individual page for recipes which contain an atlas definition
"""
if not recipe_with_atlas.atlas:
- 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 apply_label_classes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def apply_label_classes(self, arc_lyr_to_add, recipe_lyr):
if arc_lyr_to_add.supports("LABELCLASSES"):
for labelClass in recipe_lyr.label_classes:
for lblClass in arc_lyr_to_add.labelClasses:
if (lblClass.className == labelClass.class_name):
- 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 get_layer_properties
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_layer_properties(file):
lyr = arcpy.mapping.Layer(file)
layerName = lyr.name.encode('utf-8').strip()
if lyr.supports("DEFINITIONQUERY"):
- 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 showLegendEntries
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def showLegendEntries(self):
for legend in arcpy.mapping.ListLayoutElements(self.mxd, "LEGEND_ELEMENT"):
layerNames = list()
for lyr in legend.listLegendItemLayers():
if ((lyr.name in self.legendEntriesToRemove) or (lyr.name in layerNames)):
- 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 _get_version_number
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_version_number():
travis_build = environ.get('TRAVIS_BUILD_NUMBER')
travis_tag = environ.get('TRAVIS_TAG')
if travis_build:
- 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 cook
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cook(self, recipe):
arcpy.env.addOutputsToMap = False
self.disableLayers()
self.removeLayers()
- 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 removeLayers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def removeLayers(self):
"""
Removes all layers for all data-frames
"""
for df in arcpy.mapping.ListDataFrames(self.mxd):
- 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"