rogeriozambon/svg_charts

View on GitHub

Showing 10 of 10 total issues

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

  def initialize(data, width, height, y_retreat, x_retreat)
Severity: Minor
Found in lib/svg_charts/coordinates/bar.rb - About 35 mins to fix

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

      def initialize(data, width, height, y_retreat, x_retreat)
    Severity: Minor
    Found in lib/svg_charts/coordinates/line.rb - About 35 mins to fix

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

        def text(params = {})
          "<text x=\"#{params[:x]}\" y=\"#{params[:y]}\" fill=\"#{params[:color]}\" font-size=\"#{params[:font_size]}\" font-weight=\"#{params[:font_weight]}\">#{params[:value]}</text>"
      Severity: Major
      Found in lib/svg_charts/charts/elements.rb and 3 other locations - About 35 mins to fix
      lib/svg_charts/charts/elements.rb on lines 2..3
      lib/svg_charts/charts/elements.rb on lines 6..7
      lib/svg_charts/charts/elements.rb on lines 10..11

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

      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 4 locations. Consider refactoring.
      Open

        def line_dashed(params = {})
          "<line x1=\"#{params[:x1]}\" y1=\"#{params[:y1]}\" x2=\"#{params[:x2]}\" y2=\"#{params[:y2]}\" stroke-width=\"#{params[:line_width]}\" stroke=\"#{params[:color]}\" stroke-dasharray=\"5,5\" />"
      Severity: Major
      Found in lib/svg_charts/charts/elements.rb and 3 other locations - About 35 mins to fix
      lib/svg_charts/charts/elements.rb on lines 2..3
      lib/svg_charts/charts/elements.rb on lines 10..11
      lib/svg_charts/charts/elements.rb on lines 18..19

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

      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 4 locations. Consider refactoring.
      Open

        def circle(params = {})
          "<circle cx=\"#{params[:x]}\" cy=\"#{params[:y]}\" r=\"#{params[:radius]}\" stroke=\"#{params[:line_color]}\" stroke-width=\"#{params[:line_width]}\" fill=\"#{params[:background]}\" />"
      Severity: Major
      Found in lib/svg_charts/charts/elements.rb and 3 other locations - About 35 mins to fix
      lib/svg_charts/charts/elements.rb on lines 2..3
      lib/svg_charts/charts/elements.rb on lines 6..7
      lib/svg_charts/charts/elements.rb on lines 18..19

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

      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 4 locations. Consider refactoring.
      Open

        def line(params = {})
          "<line x1=\"#{params[:x1]}\" y1=\"#{params[:y1]}\" x2=\"#{params[:x2]}\" y2=\"#{params[:y2]}\" stroke-width=\"#{params[:line_width]}\" stroke=\"#{params[:color]}\" />"
      Severity: Major
      Found in lib/svg_charts/charts/elements.rb and 3 other locations - About 35 mins to fix
      lib/svg_charts/charts/elements.rb on lines 6..7
      lib/svg_charts/charts/elements.rb on lines 10..11
      lib/svg_charts/charts/elements.rb on lines 18..19

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

      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

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

          def scale(options)
            validation options, [:y_label, :x_label]
      
            %{
              #{create_line_to_scale_y_axis},
      Severity: Minor
      Found in lib/svg_charts/charts/bar.rb and 1 other location - About 30 mins to fix
      lib/svg_charts/charts/line.rb on lines 15..22

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

      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

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

          def scale(options)
            validation options, [:y_label, :x_label]
      
            %{
              #{create_line_to_scale_y_axis},
      Severity: Minor
      Found in lib/svg_charts/charts/line.rb and 1 other location - About 30 mins to fix
      lib/svg_charts/charts/bar.rb on lines 15..22

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

      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

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

          def initialize(options)
            validation options, [:width, :height, :y_retreat, :x_retreat]
      
            @width = options[:width]
            @height = options[:height]
      Severity: Minor
      Found in lib/svg_charts/charts/bar.rb and 1 other location - About 15 mins to fix
      lib/svg_charts/charts/line.rb on lines 5..12

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

      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

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

          def initialize(options)
            validation options, [:width, :height, :y_retreat, :x_retreat]
      
            @width = options[:width]
            @height = options[:height]
      Severity: Minor
      Found in lib/svg_charts/charts/line.rb and 1 other location - About 15 mins to fix
      lib/svg_charts/charts/bar.rb on lines 5..12

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

      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

      Severity
      Category
      Status
      Source
      Language