Showing 27 of 31 total issues
Avoid too many return
statements within this method. Open
return build_data(TERNARY_REGEX, Languages::TERNARY_LABEL, true)
Avoid too many return
statements within this method. Open
when Languages::UNLESS_LABEL then return true
Method check_for_lambda
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_for_lambda(pLine)
# (\w+\s+|\s*)lambda(:?\s+do\s*|\s*\{)(\s*$|\s*\|.*)
regexLambda = [/(\w+\s+|\s*)lambda(:?\s+do|\s*\{)\s*/,
/(\s*\w+\s+|\s*)->\s*\(:?.*\)/]
regexLambda.each do |lambdaSyntaxRegex|
- 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 get_variable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_variable(pLine)
varCandidates = @variableBehaviour.common_declaration(pLine)
return nil if varCandidates.empty?
globalVariables = []
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute(pElementFile, pLine)
classElement = @language.processed_line
if classElement
classElement.comments = @language.string_comment_to_transfer
- 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 analyse_first_step
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def analyse_first_step(fileElement, source)
source.each do |line|
next if line.gsub(/\s+/, '').size.zero?
processedLines = handle_semicolon(line)
next if processedLines.nil?
- 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 check_source
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_source
if !@configurationInfo.key?:source
Util::LoggerKuniri.error('Problem with source parameter')
raise Error::ConfigurationFileError
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"