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"]
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'"
- Read upRead up
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'"
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
- Read upRead up
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"
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.
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
- Read upRead up
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
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"
- Read upRead up
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.
- Read upRead up
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?
- Read upRead up
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?
- Read upRead up
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:"
- Read upRead up
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()
- Read upRead up
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()
- Read upRead up
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
- Read upRead up
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"