Showing 13 of 34 total issues
Class OptionsBuilder
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class OptionsBuilder
include ApexCharts::Utils::Hash
include ApexCharts::Utils::DateTime
attr_accessor :built
File options_builder.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ApexCharts
class OptionsBuilder
include ApexCharts::Utils::Hash
include ApexCharts::Utils::DateTime
Function exports
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
Method build_yaxis
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_yaxis
yaxis = @options.delete :yaxis
case yaxis
when Array
Method build_chart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_chart
built[:chart] =
if target = @options.delete(:brushTarget)
{
brush: {enabled: true, target: target.to_s},
- Read upRead up
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 build_yaxis
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_yaxis
yaxis = @options.delete :yaxis
case yaxis
when Array
- Read upRead up
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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(data)
data = deep_copy(data)
sanitized =
case data
when Array
- Read upRead up
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 convert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert(input)
case input
when Time
(input.to_f * 1000).round
when ::DateTime, Date
- Read upRead up
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 convert_range
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert_range(input)
input_first, input_last = input.first, input.last
case input_first
when Time
to_milliseconds_range(input_first, input_last)
- Read upRead up
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 annotation_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def annotation_value(axis, value)
axis = axis.to_s.delete_suffix('axis').to_sym
case value
when Range
value = ApexCharts::Utils::DateTime.convert_range(value)
- Read upRead up
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 build_series_from_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_series_from_hash(data)
if data_value = data[:data]
if array_of_pairs?(data_value)
data[:data] = array_of_array_to_array_of_xy(data_value)
[data]
- Read upRead up
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 type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def type(input)
case input
when Time, ::DateTime, Date
'datetime'
else
- Read upRead up
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 annotation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def annotation(axis, value:, text:, color: nil, **options)
@annotations ||= {}
raise "unrecognized axis: #{axis}" unless %i[xaxis yaxis points].include? axis
- Read upRead up
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"