ManaManaFramework/manamana

View on GitHub

Showing 14 of 36 total issues

Method tokenize has a Cognitive Complexity of 130 (exceeds 5 allowed). Consider refactoring.
Open

      def tokenize(data)
        data = data.unpack("c*") if(data.is_a?(String))
        eof = data.length
        token_array = []

Severity: Minor
Found in lib/manamana/rdsl/lexer.rb - About 2 days 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 tokenize has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
Open

      def tokenize(data)
        data = data.unpack("c*") if(data.is_a?(String))
        eof = data.length
        token_array = []

Severity: Minor
Found in lib/manamana/tdsl/lexer.rb - About 2 days 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 tokenize has 215 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def tokenize(data)
        data = data.unpack("c*") if(data.is_a?(String))
        eof = data.length
        token_array = []

Severity: Major
Found in lib/manamana/rdsl/lexer.rb - About 1 day to fix

    Method initialize has 209 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def initialize
            
    # line 21 "lib/manamana/tdsl/lexer.rb"
    class << self
        attr_accessor :_lexer_actions
    Severity: Major
    Found in lib/manamana/tdsl/lexer.rb - About 1 day to fix

      Method tokenize has 187 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def tokenize(data)
              data = data.unpack("c*") if(data.is_a?(String))
              eof = data.length
              token_array = []
      
      
      Severity: Major
      Found in lib/manamana/tdsl/lexer.rb - About 7 hrs to fix

        Method initialize has 179 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def initialize
                
        # line 20 "lib/manamana/rdsl/lexer.rb"
        class << self
            attr_accessor :_lexer_actions
        Severity: Major
        Found in lib/manamana/rdsl/lexer.rb - About 7 hrs to fix

          File lexer.rb has 430 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module ManaMana
          
            module RDSL
          
              class Lexer
          Severity: Minor
          Found in lib/manamana/rdsl/lexer.rb - About 6 hrs to fix

            File lexer.rb has 418 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ManaMana
            
              module TDSL
            
                class Lexer
            Severity: Minor
            Found in lib/manamana/tdsl/lexer.rb - About 6 hrs to fix

              File parser.rb has 254 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'racc/parser.rb'
              
              require 'manamana/rdsl/lexer'
              require 'manamana/rdsl/nodes'
              
              
              Severity: Minor
              Found in lib/manamana/rdsl/parser.rb - About 2 hrs to fix

                Method translate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def translate(requirement)
                        spec = ""
                        spec << "  describe %Q%#{ requirement }% do\n"
                        spec << "    before do\n"
                
                
                Severity: Minor
                Found in lib/manamana/tdsl/nodes.rb - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                              case _lexer_actions[_acts - 1]
                  when 3 then
                  # line 1 "NONE"
                          begin
                  te = p+1
                  Severity: Major
                  Found in lib/manamana/rdsl/lexer.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                case _lexer_actions[_acts - 1]
                    when 2 then
                    # line 1 "NONE"
                            begin
                    te = p+1
                    Severity: Major
                    Found in lib/manamana/tdsl/lexer.rb - About 45 mins to fix

                      Method recursive_require has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def recursive_require(in_dir)
                            Dir.entries(in_dir).each do |entry|
                              next if ['.', '..'].include? entry
                      
                              path = File.join(in_dir, entry)
                      Severity: Minor
                      Found in lib/manamana/runner.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 load_files has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def load_files(in_dir, lines = '')
                            Dir.entries(in_dir).each do |entry|
                              next if ['.', '..'].include? entry
                      
                              path = File.join(in_dir, entry)
                      Severity: Minor
                      Found in lib/manamana/compiler.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

                      Severity
                      Category
                      Status
                      Source
                      Language