matkoniecz/CartoCSSHelper

View on GitHub

Showing 77 of 77 total issues

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

    def self.visualise_on_synthethic_data(tags, type, on_water, zlevel_range, new_branch, old_branch)
Severity: Minor
Found in lib/cartocss_helper/visualise_changes_image_generation.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 find_data_pair has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def self.find_data_pair(tags_a, tags_b, latitude, longitude, type_a, type_b, bb_size: 0.1, distance_in_meters: 20, invalidate_cache: false)
    Severity: Minor
    Found in lib/cartocss_helper/overpass_query_generator.rb - About 45 mins to fix

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

          def self.magnacarto_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 pack_image_sets has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def self.pack_image_sets(old, new, header, new_branch, old_branch, image_size)
        Severity: Minor
        Found in lib/cartocss_helper/visualise_changes_image_generation.rb - About 45 mins to fix

          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_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 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 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_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, 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 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 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 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(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 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 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 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 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language