matkoniecz/CartoCSSHelper

View on GitHub
lib/cartocss_helper/renderer_handler.rb

Summary

Maintainability
B
6 hrs
Test Coverage

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 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 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 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 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

              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

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

                    def self.kosmtik_command(lat, lon, zlevel, bbox_size, image_size, export_filename)
                      mapnik_override = CartoCSSHelper::Configuration.mapnik_reference_version_override
                      additional_params = ""
                      additional_params += " --mapnik-version=#{mapnik_override}" if mapnik_override
                      return base_kosmtik_command(lat, lon, zlevel, bbox_size, image_size, export_filename, additional_params: additional_params)
                Severity: Minor
                Found in lib/cartocss_helper/renderer_handler.rb and 1 other location - About 20 mins to fix
                lib/cartocss_helper/renderer_handler.rb on lines 35..39

                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 28.

                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

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

                    def self.magnacarto_command(lat, lon, zlevel, bbox_size, image_size, export_filename)
                      mapnik_override = CartoCSSHelper::Configuration.mapnik_reference_version_override
                      additional_params = " --renderer=magnacarto"
                      additional_params += " --mapnik-version=#{mapnik_override}" if mapnik_override
                      return base_kosmtik_command(lat, lon, zlevel, bbox_size, image_size, export_filename, additional_params: additional_params)
                Severity: Minor
                Found in lib/cartocss_helper/renderer_handler.rb and 1 other location - About 20 mins to fix
                lib/cartocss_helper/renderer_handler.rb on lines 28..32

                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 28.

                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

                There are no issues that match your filters.

                Category
                Status