damphyr/rutema

View on GitHub

Showing 20 of 20 total issues

Method run_scenario has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

      def run_scenario(name, scenario, meta, is_special)
        executed_steps=[]
        status=:skipped
        begin 
          stps=scenario.steps
Severity: Minor
Found in lib/rutema/core/runner.rb - About 4 hrs 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 run has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

      def run(spec, is_special = false)
        begin
          @context["spec_name"]=spec.name
          steps=[]
          status=:success
Severity: Minor
Found in lib/rutema/core/runner.rb - About 2 hrs 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 run has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def run(spec, is_special = false)
        begin
          @context["spec_name"]=spec.name
          steps=[]
          status=:success
Severity: Minor
Found in lib/rutema/core/runner.rb - About 1 hr to fix

    Method run_scenario has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def run_scenario(name, scenario, meta, is_special)
            executed_steps=[]
            status=:skipped
            begin 
              stps=scenario.steps
    Severity: Minor
    Found in lib/rutema/core/runner.rb - About 1 hr to fix

      Method update has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

            def update message
              unless @mode=="off"
                case message
                when RunnerMessage
                  if message.status == :error
      Severity: Minor
      Found in lib/rutema/core/reporter.rb - About 1 hr 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 report has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            def report specs,states,errors
              failures=[]
              states.each{|k,v| failures<<v.test if v.status==:error}
      
              unless @silent
      Severity: Minor
      Found in lib/rutema/core/reporter.rb - About 1 hr 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 test_case has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def test_case name,state
              #<testcase name="" time="">      => the results from executing a test method
              #  <system-out>  => data written to System.out during the test run
              #  <system-err>  => data written to System.err during the test run
              #  <skipped/>    => test was skipped
      Severity: Minor
      Found in lib/rutema/reporters/junit.rb - About 1 hr to fix

        Method output has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def output
              msg=""
              msg<<"#{@out}\n" unless @out.empty?
              msg<<@err unless @err.empty?
              msg<<"\n" + (@backtrace.kind_of?(Array) ? @backtrace.join("\n") : @backtrace) unless @backtrace.empty?
        Severity: Minor
        Found in lib/rutema/core/framework.rb - About 55 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 parse_specification has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def parse_specification param
                @parsed||=[]
                begin
                  if File.exist?(param)
                    txt=File.read(param)
        Severity: Minor
        Found in lib/rutema/parsers/xml.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 exit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def exit
                puts "Exiting #{self.class}" if $DEBUG
                if @thread
                  puts "Reporter died with #{@queue.size} messages in the queue" unless @thread.alive?
                  while @queue.size>0 && @thread.alive? do
        Severity: Minor
        Found in lib/rutema/core/reporter.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 run! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def run!
                @thread=Thread.new do
                  while true do
                    data=@queue.pop
                    begin
        Severity: Minor
        Found in lib/rutema/core/reporter.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def initialize configuration
              @queue=Queue.new
              @parser=instantiate_class(configuration.parser,configuration) if configuration.parser
              if configuration.runner
                if configuration.runner[:class]
        Severity: Minor
        Found in lib/rutema/core/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 extension_handling has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def extension_handling spec
                #change into the directory the spec is in to handle relative paths correctly
                Dir.chdir(File.dirname(File.expand_path(spec.filename))) do |path|
                  spec.scenario.steps.each do |step|
                    #do we have a method to handle the element?
        Severity: Minor
        Found in lib/rutema/parsers/xml.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 method_missing has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def method_missing symbol,*args
              @attributes||=Hash.new
              key=symbol.id2name.chomp('?').chomp('=').sub(/^has_/,"")
              @attributes[:"#{key}"]=args[0] if key+"="==symbol.id2name
              if @attributes.has_key?(:"#{key}")
        Severity: Minor
        Found in lib/rutema/core/objectmodel.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 run_scenarios has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def run_scenarios(specs, suite_setup, suite_teardown, setup, teardown)
              if specs.empty?
                error(nil,"No tests to run")
              else
                @runner.setup = nil
        Severity: Minor
        Found in lib/rutema/core/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 run_scenarios has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def run_scenarios(specs, suite_setup, suite_teardown, setup, teardown)
        Severity: Minor
        Found in lib/rutema/core/engine.rb - About 35 mins to fix

          Method initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize command_line_args
                parse_command_line(command_line_args)
                @configuration=Rutema::Configuration.new(@config_file)
                @configuration.context||={}
                @configuration.context[:config_file]=File.expand_path(@config_file)
          Severity: Minor
          Found in lib/rutema/application.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize params
                begin
                  @attributes=params
                end if params
                @attributes||=Hash.new
          Severity: Minor
          Found in lib/rutema/core/objectmodel.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 validate_case has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def validate_case xmldoc
                  raise Rutema::ParserError,"missing #{ELEM_SPEC} element in #{xmldoc}" unless xmldoc.elements[ELEM_SPEC]
                  raise Rutema::ParserError,"missing #{ELEM_DESC} element in #{xmldoc}" unless xmldoc.elements[ELEM_DESC]
                  raise Rutema::ParserError,"missing #{ELEM_TITLE} element in #{xmldoc}" unless xmldoc.elements[ELEM_TITLE]
                end
          Severity: Minor
          Found in lib/rutema/parsers/xml.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 parse_case has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def parse_case xmltxt,filename
                  spec=Rutema::Specification.new({})
                  xmldoc=REXML::Document.new( xmltxt )
                  validate_case(xmldoc)
                  xmldoc.root.attributes.each do |attr,value|
          Severity: Minor
          Found in lib/rutema/parsers/xml.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