Kuniri/kuniri

View on GitHub

Showing 27 of 31 total issues

Avoid too many return statements within this method.
Open

          return build_data(TERNARY_REGEX, Languages::TERNARY_LABEL, true)
Severity: Major
Found in lib/kuniri/language/ruby/conditional_ruby.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            when Languages::UNLESS_LABEL then return true
    Severity: Major
    Found in lib/kuniri/state_machine/OO_structured_fsm/basic_structure_state.rb - About 30 mins to fix

      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|
      Severity: Minor
      Found in lib/kuniri/language/ruby/block_ruby.rb - About 25 mins to fix

      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 = []
      Severity: Minor
      Found in lib/kuniri/language/ruby/variable_global_ruby.rb - About 25 mins to fix

      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
      Severity: Minor
      Found in lib/kuniri/state_machine/OO_structured_fsm/class_state.rb - About 25 mins to fix

      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?
      Severity: Minor
      Found in lib/kuniri/language/ruby/ruby_syntax.rb - About 25 mins to fix

      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
      Severity: Minor
      Found in lib/kuniri/core/setting.rb - About 25 mins to fix

      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

      Severity
      Category
      Status
      Source
      Language