matkoniecz/CartoCSSHelper

View on GitHub

Showing 77 of 77 total issues

Method visualise_for_location has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.visualise_for_location(latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size = 0.4, image_size = 400)
Severity: Major
Found in lib/cartocss_helper/visualise_changes_image_generation.rb - About 1 hr to fix

    Method visualise_on_overpass_data has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def self.visualise_on_overpass_data(tags, type, wanted_latitude, wanted_longitude, zlevels, new_branch, old_branch = 'master')
    Severity: Major
    Found in lib/cartocss_helper/visualise_changes_image_generation.rb - About 50 mins to fix

      Method visualise_place_by_url has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def self.visualise_place_by_url(url, zlevels, new_branch, old_branch = 'master', header = nil, download_bbox_size = 0.04, image_size = 350)
      Severity: Major
      Found in lib/cartocss_helper.rb - About 50 mins to fix

        Method request_image_from_renderer has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def self.request_image_from_renderer(lat, lon, zlevel, bbox_size, image_size, export_filename, debug = false)
        Severity: Major
        Found in lib/cartocss_helper/renderer_handler.rb - About 50 mins to fix

          Method test_tag_on_real_data has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def self.test_tag_on_real_data(tags, new_branch, old_branch, zlevels, types = ['node', 'closed_way', 'way'], min = 4, skip = 0)
          Severity: Major
          Found in lib/cartocss_helper.rb - About 50 mins to fix

            Method test_tag_on_real_data_for_this_type has 7 arguments (exceeds 4 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)
            Severity: Major
            Found in lib/cartocss_helper.rb - About 50 mins to fix

              Method image_available_from_cache has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def self.image_available_from_cache(lat, lon, zlevel, bbox_size, image_size, export_filename, debug = false)
              Severity: Major
              Found in lib/cartocss_helper/renderer_handler.rb - About 50 mins to fix

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

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

                    def self.test(tags, new_branch, old_branch = 'master', zlevels = Configuration.get_min_z..Configuration.get_max_z, types = ['node', 'closed_way', 'way'], test_on_water = false)
                  Severity: Minor
                  Found in lib/cartocss_helper.rb - About 45 mins to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        def self.overpass_bbox_string(latitude, longitude, size)
                          min_latitude = latitude - size / 2
                          max_latitude = latitude + size / 2
                          min_longitude = longitude - size / 2
                          max_longitude = longitude + size / 2
                    Severity: Minor
                    Found in lib/cartocss_helper/overpass_query_generator.rb and 1 other location - About 45 mins to fix
                    lib/cartocss_helper/notes_downloader.rb on lines 37..43

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 40.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                        def self.kosmtik_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_tags_from_mss_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def get_tags_from_mss_file(style_filename)
                            possible_key_values = get_tags_from_osm2pqsql
                            tags = Set.new
                            # puts style_filename
                            style_file = open(style_filename)
                      Severity: Minor
                      Found in lib/cartocss_helper/heuristic.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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          def self.osm_api_bbox_string(latitude, longitude, size)
                            # bbox=left,bottom,right,top
                            min_latitude = latitude - size / 2
                            max_latitude = latitude + size / 2
                            min_longitude = longitude - size / 2
                      Severity: Minor
                      Found in lib/cartocss_helper/notes_downloader.rb and 1 other location - About 45 mins to fix
                      lib/cartocss_helper/overpass_query_generator.rb on lines 28..33

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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 check_dy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def check_dy(tags, zlevel, interactive = false, on_water = false)
                              unless is_object_displaying_anything_as_node tags, zlevel, on_water
                                # puts key+"="+value+" - not displayed as node on z#{zlevel}"
                                return
                              end
                        Severity: Minor
                        Found in lib/cartocss_helper/validator.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 turn_tag_into_overpass_filter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def self.turn_tag_into_overpass_filter(tag)
                              filter_data = translate_tag_object_into_filter_data(tag)
                              value = filter_data[:value]
                              key = filter_data[:key]
                              operator = filter_data[:operator]
                        Severity: Minor
                        Found in lib/cartocss_helper/overpass_query_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 probe has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def self.probe(tags, new_branch, old_branch = 'master', zlevels = Configuration.get_min_z..Configuration.get_max_z, types = ['node', 'closed_way', 'way'], test_on_water = false)
                        Severity: Minor
                        Found in lib/cartocss_helper.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 test_tag_on_sythetic_data has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              def self.test_tag_on_sythetic_data(tags, new_branch, old_branch = 'master', zlevels = Configuration.get_min_z..Configuration.get_max_z, types = ['node', 'closed_way', 'way'], test_on_water = false)
                            Severity: Minor
                            Found in lib/cartocss_helper.rb - About 45 mins to fix

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

                                  def self.base_kosmtik_command(lat, lon, zlevel, bbox_size, image_size, export_filename, additional_params: '')
                              Severity: Minor
                              Found in lib/cartocss_helper/renderer_handler.rb - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language