matkoniecz/CartoCSSHelper

View on GitHub

Showing 69 of 77 total issues

Method find_command has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.find_command(lat, lon, zlevel, bbox_size, image_size, export_filename)
Severity: Minor
Found in lib/cartocss_helper/renderer_handler.rb - About 45 mins to fix

    Method get_query_to_get_location_set_format has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def self.get_query_to_get_location_set_format(tags, type, latitude, longitude, range, format)
    Severity: Minor
    Found in lib/cartocss_helper/overpass_query_generator.rb - About 45 mins to fix

      Method get_image_filename has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_image_filename(debug = false) # TODO: misleading name - should be location
            lat = 0
            lon = 20
            lon = 0 if @on_water
            if @generated_image_location != nil
      Severity: Minor
      Found in lib/cartocss_helper/image_generator.rb - About 45 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

      Method collect_images_for_real_data_test has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def self.collect_images_for_real_data_test(latitude, longitude, zlevels, source, image_size = 400)
      Severity: Minor
      Found in lib/cartocss_helper/visualise_changes_image_generation.rb - About 35 mins to fix

        Method get_elements_near_given_location has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def self.get_elements_near_given_location(tags, type, latitude, longitude, range_in_meters, invalidate_cache: false)
        Severity: Minor
        Found in lib/cartocss_helper/overpass_query_generator.rb - About 35 mins to fix

          Method is_key_rendered_and_value_ignored_set has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def is_key_rendered_and_value_ignored_set(key, value, type, zlevel, on_water)
          Severity: Minor
          Found in lib/cartocss_helper/tag_lister.rb - About 35 mins to fix

            Method locate_element_with_given_tags_and_type has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def self.locate_element_with_given_tags_and_type(tags, type, latitude, longitude, max_range_in_km_for_radius = 1600)
            Severity: Minor
            Found in lib/cartocss_helper/overpass_query_generator.rb - About 35 mins to fix

              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def initialize(before, after, header, filename, image_size)
              Severity: Minor
              Found in lib/cartocss_helper/visualise_changes_diff_from_images.rb - About 35 mins to fix

                Method get_query_element_to_get_location has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def self.get_query_element_to_get_location(tags, latitude, longitude, type, range)
                Severity: Minor
                Found in lib/cartocss_helper/overpass_query_generator.rb - About 35 mins to fix

                  Method is_object_displaying_name_as_this_object_type has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def is_object_displaying_name_as_this_object_type(tags, name, zlevel, on_water, type)
                  Severity: Minor
                  Found in lib/cartocss_helper/validator.rb - About 35 mins to fix

                    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def initialize(min_z, max_z, list_of_documented_tags, list_of_documented_compositions, name_label_is_not_required)
                    Severity: Minor
                    Found in lib/cartocss_helper/style_specific/style_specific.rb - About 35 mins to fix

                      Method get_query_to_get_location has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def self.get_query_to_get_location(tags, type, latitude, longitude, range)
                      Severity: Minor
                      Found in lib/cartocss_helper/overpass_query_generator.rb - About 35 mins to fix

                        Method is_rendered_with_this_composite has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def is_rendered_with_this_composite(tags, type, provided_composite, zlevel, on_water)
                        Severity: Minor
                        Found in lib/cartocss_helper/tag_lister.rb - About 35 mins to fix

                          Method get_query_to_find_data_pair has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def self.get_query_to_find_data_pair(bb, tags_a, tags_b, type_a, type_b, distance_in_meters: 20)
                          Severity: Minor
                          Found in lib/cartocss_helper/overpass_query_generator.rb - About 35 mins to fix

                            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def initialize(tags, type, lat, lon, size)
                            Severity: Minor
                            Found in lib/cartocss_helper/data_file_handling.rb - About 35 mins to fix

                              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def initialize(tags, zlevel, on_water, type, show_what_is_generated = false)
                              Severity: Minor
                              Found in lib/cartocss_helper/image_generator.rb - About 35 mins to fix

                                Method how_rendered_on_zlevel_as_composite has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def how_rendered_on_zlevel_as_composite(tags, type, zlevel, on_water, suggested_composite)
                                Severity: Minor
                                Found in lib/cartocss_helper/tag_lister.rb - About 35 mins to fix

                                  Method test_tag_on_real_data_for_this_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def self.test_tag_on_real_data_for_this_type(tags, new_branch, old_branch, zlevels, type, min = 4, skip = 0)
                                      type = type[0] if type.is_a?(Array)
                                      generated = 0
                                  
                                      n = 0
                                  Severity: Minor
                                  Found in lib/cartocss_helper.rb - 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

                                  Method print_render_state_of_tag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def print_render_state_of_tag(key, value)
                                        if is_rendered key, value
                                          @last_composite = nil
                                          if value == get_generic_tag_value
                                            puts "#{key}=#{value} - primary generic tag value"
                                  Severity: Minor
                                  Found in lib/cartocss_helper/tag_lister.rb - 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

                                  Method get_specified_resource has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def get_specified_resource(url, description: nil)
                                      Log.info description if description
                                      return @wrapper.fetch_data_from_url(url, @request_timeout)
                                    rescue ExceptionWithResponse => e
                                      output_shared_error_part(url, e)
                                  Severity: Minor
                                  Found in lib/cartocss_helper/util/generic_downloader.rb - 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