lib/carto/named_maps/template.rb
Class Template
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Template
NAMED_MAPS_VERSION = '0.0.1'.freeze
MAP_CONFIG_VERSION = '1.5.0'.freeze
NAME_PREFIX = 'tpl_'.freeze
AUTH_TYPE_OPEN = 'open'.freeze
Method options_for_carto_and_torque_layers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def options_for_carto_and_torque_layers(layer, index, is_builder)
layer_options = layer.options.with_indifferent_access
tile_style = layer_options[:tile_style].strip if layer_options[:tile_style]
options = {
- 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 layers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def layers
layers = []
layer_index = -1 # forgive me for I have sinned
is_builder = @visualization.builder?
- 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"