styd/apexcharts.rb

View on GitHub

Showing 21 of 34 total issues

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

    def build_selection_range
      last_data = @series[:series].last[:data]
      first_x = last_data.first[:x]
      last_x = last_data.last[:x]
      @options[:chart][:selection][:xaxis] = {
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 1 other location - About 35 mins to fix
lib/apex_charts/charts/cartesian_chart.rb on lines 64..71

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 build_selection_range
      last_data = @series[:series].last[:data]
      first_x = last_data.first[:x]
      last_x = last_data.last[:x]
      @options[:chart][:selection][:xaxis] = {
Severity: Minor
Found in lib/apex_charts/charts/cartesian_chart.rb and 1 other location - About 35 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 89..96

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

    def column_chart(data, options={}, &block)
      options[:id] = apexcharts_id
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @html +=
        ColumnChart.new(outer_self, data, @options.merge(options), &block).render
Severity: Major
Found in lib/apex_charts/charts/syncing_charts.rb and 4 other locations - About 25 mins to fix
lib/apex_charts/charts/syncing_charts.rb on lines 17..22
lib/apex_charts/charts/syncing_charts.rb on lines 24..29
lib/apex_charts/charts/syncing_charts.rb on lines 31..36
lib/apex_charts/charts/syncing_charts.rb on lines 45..50

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

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

    def bar_chart(data, options={}, &block)
      options[:id] = apexcharts_id
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @html +=
        BarChart.new(outer_self, data, @options.merge(options), &block).render
Severity: Major
Found in lib/apex_charts/charts/syncing_charts.rb and 4 other locations - About 25 mins to fix
lib/apex_charts/charts/syncing_charts.rb on lines 17..22
lib/apex_charts/charts/syncing_charts.rb on lines 24..29
lib/apex_charts/charts/syncing_charts.rb on lines 38..43
lib/apex_charts/charts/syncing_charts.rb on lines 45..50

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

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

    def area_chart(data, options={}, &block)
      options[:id] = apexcharts_id
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @html +=
        AreaChart.new(outer_self, data, @options.merge(options), &block).render
Severity: Major
Found in lib/apex_charts/charts/syncing_charts.rb and 4 other locations - About 25 mins to fix
lib/apex_charts/charts/syncing_charts.rb on lines 17..22
lib/apex_charts/charts/syncing_charts.rb on lines 31..36
lib/apex_charts/charts/syncing_charts.rb on lines 38..43
lib/apex_charts/charts/syncing_charts.rb on lines 45..50

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

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

    def line_chart(data, options={}, &block)
      options[:id] = apexcharts_id
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @html +=
        LineChart.new(outer_self, data, @options.merge(options), &block).render
Severity: Major
Found in lib/apex_charts/charts/syncing_charts.rb and 4 other locations - About 25 mins to fix
lib/apex_charts/charts/syncing_charts.rb on lines 24..29
lib/apex_charts/charts/syncing_charts.rb on lines 31..36
lib/apex_charts/charts/syncing_charts.rb on lines 38..43
lib/apex_charts/charts/syncing_charts.rb on lines 45..50

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

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

    def scatter_chart(data, options={}, &block)
      options[:id] = apexcharts_id
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @html +=
        ScatterChart.new(outer_self, data, @options.merge(options), &block).render
Severity: Major
Found in lib/apex_charts/charts/syncing_charts.rb and 4 other locations - About 25 mins to fix
lib/apex_charts/charts/syncing_charts.rb on lines 17..22
lib/apex_charts/charts/syncing_charts.rb on lines 24..29
lib/apex_charts/charts/syncing_charts.rb on lines 31..36
lib/apex_charts/charts/syncing_charts.rb on lines 38..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 30.

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

    def candlestick_chart(data, options={}, &block)
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @series[:series] +=
        CandlestickChart.new(outer_self, data, options, &block).mixed_series
    end
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 5 other locations - About 15 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 28..32
lib/apex_charts/charts/mixed_charts.rb on lines 34..38
lib/apex_charts/charts/mixed_charts.rb on lines 40..44
lib/apex_charts/charts/mixed_charts.rb on lines 52..56
lib/apex_charts/charts/mixed_charts.rb on lines 58..62

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

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

    def bar_chart(data, options={}, &block)
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @series[:series] +=
        BarChart.new(outer_self, data, options, &block).mixed_series
    end
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 5 other locations - About 15 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 28..32
lib/apex_charts/charts/mixed_charts.rb on lines 34..38
lib/apex_charts/charts/mixed_charts.rb on lines 46..50
lib/apex_charts/charts/mixed_charts.rb on lines 52..56
lib/apex_charts/charts/mixed_charts.rb on lines 58..62

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

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

      def column_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::ColumnChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 17..22
lib/apex_charts/helper.rb on lines 26..31
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 53..58
lib/apex_charts/helper.rb on lines 62..67
lib/apex_charts/helper.rb on lines 71..76
lib/apex_charts/helper.rb on lines 81..86

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

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

      def scatter_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::ScatterChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 17..22
lib/apex_charts/helper.rb on lines 26..31
lib/apex_charts/helper.rb on lines 35..40
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 53..58
lib/apex_charts/helper.rb on lines 71..76
lib/apex_charts/helper.rb on lines 81..86

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

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

      def range_bar_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::RangeBarChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 17..22
lib/apex_charts/helper.rb on lines 26..31
lib/apex_charts/helper.rb on lines 35..40
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 62..67
lib/apex_charts/helper.rb on lines 71..76
lib/apex_charts/helper.rb on lines 81..86

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

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

    def column_chart(data, options={}, &block)
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @series[:series] +=
        ColumnChart.new(outer_self, data, options, &block).mixed_series
    end
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 5 other locations - About 15 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 28..32
lib/apex_charts/charts/mixed_charts.rb on lines 34..38
lib/apex_charts/charts/mixed_charts.rb on lines 40..44
lib/apex_charts/charts/mixed_charts.rb on lines 46..50
lib/apex_charts/charts/mixed_charts.rb on lines 58..62

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

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

    def area_chart(data, options={}, &block)
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @series[:series] +=
        AreaChart.new(outer_self, data, options, &block).mixed_series
    end
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 5 other locations - About 15 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 28..32
lib/apex_charts/charts/mixed_charts.rb on lines 40..44
lib/apex_charts/charts/mixed_charts.rb on lines 46..50
lib/apex_charts/charts/mixed_charts.rb on lines 52..56
lib/apex_charts/charts/mixed_charts.rb on lines 58..62

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

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

      def box_plot_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::BoxPlotChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 17..22
lib/apex_charts/helper.rb on lines 26..31
lib/apex_charts/helper.rb on lines 35..40
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 53..58
lib/apex_charts/helper.rb on lines 62..67
lib/apex_charts/helper.rb on lines 71..76

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

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

    def line_chart(data, options={}, &block)
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @series[:series] +=
        LineChart.new(outer_self, data, options, &block).mixed_series
    end
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 5 other locations - About 15 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 34..38
lib/apex_charts/charts/mixed_charts.rb on lines 40..44
lib/apex_charts/charts/mixed_charts.rb on lines 46..50
lib/apex_charts/charts/mixed_charts.rb on lines 52..56
lib/apex_charts/charts/mixed_charts.rb on lines 58..62

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

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

      def candlestick_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::CandlestickChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 17..22
lib/apex_charts/helper.rb on lines 26..31
lib/apex_charts/helper.rb on lines 35..40
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 53..58
lib/apex_charts/helper.rb on lines 62..67
lib/apex_charts/helper.rb on lines 81..86

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

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

      def area_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::AreaChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 17..22
lib/apex_charts/helper.rb on lines 35..40
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 53..58
lib/apex_charts/helper.rb on lines 62..67
lib/apex_charts/helper.rb on lines 71..76
lib/apex_charts/helper.rb on lines 81..86

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

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

      def line_chart(series, options={}, &block)
        outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
        draw_chart(
          ApexCharts::Charts::LineChart.new(
            outer_self, *prepare_series_and_options(series, options), &block
Severity: Major
Found in lib/apex_charts/helper.rb and 7 other locations - About 15 mins to fix
lib/apex_charts/helper.rb on lines 26..31
lib/apex_charts/helper.rb on lines 35..40
lib/apex_charts/helper.rb on lines 44..49
lib/apex_charts/helper.rb on lines 53..58
lib/apex_charts/helper.rb on lines 62..67
lib/apex_charts/helper.rb on lines 71..76
lib/apex_charts/helper.rb on lines 81..86

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

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

    def scatter_chart(data, options={}, &block)
      outer_self = eval('self', block.binding, __FILE__, __LINE__) if block_given?
      @series[:series] +=
        ScatterChart.new(outer_self, data, options, &block).mixed_series
    end
Severity: Minor
Found in lib/apex_charts/charts/mixed_charts.rb and 5 other locations - About 15 mins to fix
lib/apex_charts/charts/mixed_charts.rb on lines 28..32
lib/apex_charts/charts/mixed_charts.rb on lines 34..38
lib/apex_charts/charts/mixed_charts.rb on lines 40..44
lib/apex_charts/charts/mixed_charts.rb on lines 46..50
lib/apex_charts/charts/mixed_charts.rb on lines 52..56

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