Terralego/django-geostore

View on GitHub

Showing 30 of 65 total issues

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

    def extra_geometry(self, request, id_extra_feature, *args, **kwargs):
Severity: Minor
Found in geostore/views/__init__.py - About 35 mins to fix

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

        def tiles(self, request, z, x, y, **kwargs):
    Severity: Minor
    Found in geostore/tiles/mixins.py - About 35 mins to fix

      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):
      Severity: Minor
      Found in geostore/import_export/imports.py - About 35 mins to fix

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

            def get_tile(self, x, y, z, name=None, features_pks=None):
        Severity: Minor
        Found in geostore/tiles/helpers.py - About 35 mins to fix

          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]
          
          
          Severity: Minor
          Found in geostore/management/commands/layer_processing.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 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')
          Severity: Minor
          Found in geostore/tiles/mixins.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 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')
          Severity: Minor
          Found in geostore/permissions.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 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
          Severity: Minor
          Found in geostore/models.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 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'),
          Severity: Minor
          Found in geostore/management/commands/layer_processing.py - About 25 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 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
          Severity: Minor
          Found in geostore/renderers.py - About 25 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