camiloribeiro/cello

View on GitHub

Showing 6 of 6 total issues

Method record has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def record args
      page_url = args.shift
      page_source = RestClient.get page_url
      title = page_source.scan(/\<title\>(.*?)\<\/title\>/)[0].to_s.gsub!(/\W+/, ' ').strip!.split(" ").each { |w| w.capitalize! }.join("")
      page = "require 'cello'\n\n"
Severity: Minor
Found in lib/cello/pageobjects/recorder.rb - About 3 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 define_extras_for_radios has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

      def define_extras_for_radios(name)
        define_method "#{name}_is_real?" do
          send(name).size > 0
        end
        define_method "#{name}_click" do
Severity: Minor
Found in lib/cello/pageobjects/html_elements/radio_helper.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 define_extras_for_radios has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def define_extras_for_radios(name)
        define_method "#{name}_is_real?" do
          send(name).size > 0
        end
        define_method "#{name}_click" do
Severity: Minor
Found in lib/cello/pageobjects/html_elements/radio_helper.rb - About 1 hr to fix

    Method define_extras has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def define_extras(name, type)
            #include LogHelper
    
            define_method "#{name}_exit_wait?" do
              send(name).visible? 
    Severity: Minor
    Found in lib/cello/pageobjects/html_elements/element_helper.rb - About 1 hr to fix

      Method define_extras_for_textarea has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def define_extras_for_textarea(name)
              define_method "#{name}_is_enable?" do
                !(send(name).disabled?)
              end
              define_method "#{name}_clear" do
      Severity: Minor
      Found in lib/cello/pageobjects/html_elements/textarea_helper.rb - About 1 hr to fix

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

              def define_extras(name, type)
                #include LogHelper
        
                define_method "#{name}_exit_wait?" do
                  send(name).visible? 
        Severity: Minor
        Found in lib/cello/pageobjects/html_elements/element_helper.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

        Severity
        Category
        Status
        Source
        Language