Showing 5 of 5 total issues
Class Base
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
attr_accessor :base_url, :callback_options, :configuration, :instance, :klass, :settings
def initialize(configuration)
ensure_loadable
Class Converter
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Converter
include ConversionExpressions
attr_reader :ending_whitespace, :options, :starting_whitespace, :string
Method characters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def characters
expressions.characters.each do |key, expression|
next if key == :slash && options[:allow_slash]
replacement = translate(key)
replacement = " #{replacement} " unless replacement == '' || key == :dot
- 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 translate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def translate(scope, key, options = {})
return if key == "." # I18n doesn't support dots as translation keys so we don't either
locale = options[:locale] || self.locale
- 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 to_html
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_html(lite_mode = false)
if defined?(RedCloth)
if lite_mode
RedCloth.new(self, [:lite_mode]).to_html
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"