richrace/escapezeta

View on GitHub

Showing 16 of 16 total issues

File EscapeZeta.rb has 449 lines of code (exceeds 250 allowed). Consider refactoring.
Open

def clear_globals()
    # Player variables
    $name = "unknown"
    $inventory = ["Hairbrush"]

Severity: Minor
Found in EscapeZeta.rb - About 6 hrs to fix

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

    def    room_actions() 
        if $next_move.include? "instructions"
            puts "-----Instructions-----"
            puts "To perform the action, type the words that follow it."
            puts "MOVE: 'up', 'down', 'left', 'right'"
    Severity: Minor
    Found in EscapeZeta.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 room_actions has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def    room_actions() 
        if $next_move.include? "instructions"
            puts "-----Instructions-----"
            puts "To perform the action, type the words that follow it."
            puts "MOVE: 'up', 'down', 'left', 'right'"
    Severity: Major
    Found in EscapeZeta.rb - About 2 hrs to fix

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

      def use()
          if $gamestart == "yes"
              puts "What will you use?"
              $use = gets.chomp()
              if $inventory.include? $use
      Severity: Minor
      Found in EscapeZeta.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 wear has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def wear()
          if $gamestart == "yes"
              puts "What will you wear?"
              wear = gets.chomp()
              if $inventory.include? "Spacesuit"
      Severity: Minor
      Found in EscapeZeta.rb - About 1 hr to fix

        Method launch_control has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def launch_control()
            $current_room = "launch_control"
            $current_room_contents = $launch_control_contents
            puts "You're in the Launch Control. Through a window above you,
            you can see a gleaming space rocket sitting on a launch pad.
        Severity: Minor
        Found in EscapeZeta.rb - About 1 hr to fix

          Method handle_use has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def handle_use
              use_inventory = InputParser.get_command "What will you use?"
              found_inventory_item = @game.inventory.find_usable_item(use_inventory)
          
              if found_inventory_item
          Severity: Minor
          Found in lib/game/handle_commands.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 use has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def use()
              if $gamestart == "yes"
                  puts "What will you use?"
                  $use = gets.chomp()
                  if $inventory.include? $use
          Severity: Minor
          Found in EscapeZeta.rb - About 1 hr to fix

            Method wear has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def wear()
                if $gamestart == "yes"
                    puts "What will you wear?"
                    wear = gets.chomp()
                    if $inventory.include? "Spacesuit"
            Severity: Minor
            Found in EscapeZeta.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 launch_control has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def launch_control()
                $current_room = "launch_control"
                $current_room_contents = $launch_control_contents
                puts "You're in the Launch Control. Through a window above you,
                you can see a gleaming space rocket sitting on a launch pad.
            Severity: Minor
            Found in EscapeZeta.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 crew_quarters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def crew_quarters()
                $current_room = "crew_quarters"
                $current_room_contents = $crew_quarters_contents
                puts "You're in the crew quarters. It contains:"
                if $crew_quarters_contents.empty?
            Severity: Minor
            Found in EscapeZeta.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 mess_hall has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def mess_hall()
                $current_room = "mess_hall"
                $current_room_contents = $mess_hall_contents
                puts "You're in the mess hall. It contains:"
                if $mess_hall_contents.empty?
            Severity: Minor
            Found in EscapeZeta.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 science_lab has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def science_lab()
                $current_room = "science_lab"
                $current_room_contents = $science_lab_contents
                
                puts "You're in the science lab. It contains:"
            Severity: Minor
            Found in EscapeZeta.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 current_room has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def current_room()
                if $current_room == "airlock1"
                    airlock1()
                elsif $current_room == "science_lab"
                    science_lab()
            Severity: Minor
            Found in EscapeZeta.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 launch_pad has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def launch_pad()
                $current_room = "launch_pad"
                puts "You're on the launch pad. A ladder leads up to the\nhatch of a space rocket."
            
                prompt; $next_move = gets.chomp()
            Severity: Minor
            Found in EscapeZeta.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 airlock1 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def airlock1()
                $gamestart = "yes"
                $current_room = "airlock1"
                $current_room_contents = $airlock1_contents
                
            Severity: Minor
            Found in EscapeZeta.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