Showing 30 of 65 total issues
Function tiles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tiles(self, request, z, x, y, **kwargs):
Function _get_layer_out
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_layer_out(self, pk, name, clear_output, verbosity):
Function _import_row_from_csv
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _import_row_from_csv(self, row, pk_properties, operations, options):
Function get_tile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_tile(self, x, y, z, name=None, features_pks=None):
Function has_object_permission
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def has_object_permission(self, request, view, obj):
if request.user.is_superuser:
return True
has_perm = request.user.has_perm('geostore.can_manage_layers')
- 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_tile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_tile(self, z, x, y):
tiles_array = []
for layer in self.layers:
minzoom = layer.layer_settings_with_default('tiles', 'minzoom')
maxzoom = layer.layer_settings_with_default('tiles', 'maxzoom')
- 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 _processing_make_valid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _processing_make_valid(self, layer_ins, layer_out):
if len(layer_ins) != 1:
raise ValueError('Exactly one input layer required')
layer_in = layer_ins[0]
- 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 sync_relations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sync_relations(self, layer_relation=None):
""" replace feature relations for automatic layer relations """
logger.info("Feature relation synchronisation")
layer_relations = self.layer.relations_as_origin.exclude(relation_type__isnull=True)
layer_relations = layer_relations.filter(pk__in=[layer_relation]) if layer_relation else layer_relations
- 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 geom_to_gpx
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def geom_to_gpx(self, geom, name, description):
"""Convert a geometry to a gpx entity.
Point -> add as a Way Point
LineString -> add all Points in a Route
Polygon -> add all Points of the external linering in a Route
- 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 handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **options):
dryrun = options.get('dry_run')
sp = transaction.savepoint()
layer_ins = self._get_layer_ins(
options.get('layer_pk_ins'),
- 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"