Kuniri/kuniri

View on GitHub

Showing 31 of 31 total issues

Class Language has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Language
    attr_reader :name
    attr_reader :path

    attr_reader :attributeState
Severity: Minor
Found in lib/kuniri/language/language.rb - About 3 hrs to fix

    Class OutputFormat has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class OutputFormat
        attr_accessor :outputEngine
        attr_accessor :parserPath
        attr_accessor :extension
        attr_reader :optimizationLevel
    Severity: Minor
    Found in lib/kuniri/parser/output_format.rb - About 2 hrs to fix

      Method method_missing has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def method_missing(pTagName, *pTagParameters, &pBlock)
            @tag << "\n" unless @tag.strip == ''
            name = @optimizationLevel != 1 ? pTagName.to_s : optimize_size(pTagName)
            currentTagName = "#{@ident}<#{name}"
            @tag << currentTagName
      Severity: Minor
      Found in lib/kuniri/parser/xml_builder_engine.rb - About 45 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 class_generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def class_generate(pClass)
            # We use it because of the block below.
            wrapper = self
            pClass.each do |singleClass|
              @outputEngine.classData name: singleClass.name,
      Severity: Minor
      Found in lib/kuniri/parser/xml_output_format.rb - About 45 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_second_step has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def analyse_second_step
            sort_all_classes
            sort_all_aggregations
      
            allActualAggregations = []
      Severity: Minor
      Found in lib/kuniri/language/ruby/ruby_syntax.rb - About 35 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 handle_line has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def handle_line(pLine)
              # TODO: This line is complex, maybe it can be simple. However, notice
              # that line_inspect method is expensive, and should be called once.
              structures = {
                CONDITIONAL_ID => method(:conditional_capture),
      Severity: Minor
      Found in lib/kuniri/state_machine/OO_structured_fsm/basic_structure_state.rb - About 35 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 handle_attribute_with_attr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def handle_attribute_with_attr(pAttributeCandidates)
              attributes = []
              pAttributeCandidates.each do |variable, _value|
                if variable =~ /^\s*(?:(?:attr_(?:accessor|reader|writer))\s+:\w+)/
                  var = variable.split(' ').last
      Severity: Minor
      Found in lib/kuniri/language/ruby/attribute_ruby.rb - About 35 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 handling_default_parameter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def handling_default_parameter(pLine)
              return pLine unless pLine =~ /=/
      
              partialParameters = if pLine =~ /,/
                                    pLine.split(',')
      Severity: Minor
      Found in lib/kuniri/language/ruby/function_behavior_ruby.rb - About 35 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 handle_equals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def handle_equals(pStringWithVariables, pStrings)
              variables = {}
              partialVariable = pStringWithVariables.split(TMP_TOKEN_EQUAL)
              value = partialVariable.pop
              value = process_value(value, pStrings)
      Severity: Minor
      Found in lib/kuniri/language/ruby/variable_behaviour_ruby.rb - About 35 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

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

                    return build_data(ELSE_REGEX, Languages::ELSE_LABEL, false, false)
          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

                      return false
            Severity: Major
            Found in lib/kuniri/state_machine/OO_structured_fsm/basic_structure_state.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                        return build_data(UNLESS_REGEX, Languages::UNLESS_LABEL)
              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

                          return nil
                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

                            return build_data(ELSIF_REGEX, Languages::ELSIF_LABEL)
                  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

                            return nil
                    Severity: Major
                    Found in lib/kuniri/language/ruby/repetition_ruby.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                return build_data(UNLESS_INLINE_REGEX, Languages::UNLESS_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

                                return nil
                        Severity: Major
                        Found in lib/kuniri/language/ruby/repetition_ruby.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

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