Showing 106 of 106 total issues
Assignment Branch Condition size for report is too high. [48/15] Open
def report
system 'clear'
puts_with_delay "\n Test Report \n\n"
sleep_with_setting
puts ' Q. | Corr | Skip | Retry '
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [35/10] Open
def start
system 'clear'
UI.puts "\nWelcome to #{'"Make all tests pass"'.light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [34/10] Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"Don't ask me Ruby or Rails\"".light_cyan}"
UI.puts "Let's check whether you remember where Ruby ends and Rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for start is too high. [39.47/15] Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"Don't ask me Ruby or Rails\"".light_cyan}"
UI.puts "Let's check whether you remember where Ruby ends and Rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for start is too high. [38.34/15] Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"What's the return value?\"".light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [30/10] Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"What's the return value?\"".light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for start is too high. [34.42/15] Open
def start
system 'clear'
UI.puts "\nWelcome to #{'"Make all tests pass"'.light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [20/10] Open
def choose
system 'clear'
UI.menu
while Config.topic = UI.gets
case Config.topic
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [15/10] Open
def report
system 'clear'
puts_with_delay "\n Test Report \n\n"
sleep_with_setting
puts ' Q. | Corr | Skip | Retry '
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Cyclomatic complexity for start is too high. [7/6] Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"Don't ask me Ruby or Rails\"".light_cyan}"
UI.puts "Let's check whether you remember where Ruby ends and Rails\n"
Score.start
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Assignment Branch Condition size for generate_question is too high. [16/15] Open
def generate_question(index)
FileUtils.mkdir_p(generate_file_path(index))
File.open(generate_file_path(index) + '/README', 'w') do |f|
f.write read_template(templates_path + '/README.erb')
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create_questions is too high. [16.49/15] Open
def create_questions
Dir[File.expand_path("../../../topic/methods/#{Config.level}/*.rb", __FILE__)].each do |file|
content = File.open(file).read.split("# methods\n")
method = content[1].split("\n")[0]
sol = UI.coderay(content[1])
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create_questions is too high. [15.52/15] Open
def create_questions
@dir.each do |dir|
Dir[File.expand_path("../../../topic/#{dir}/*.rb", __FILE__)].each do |file|
content = File.open(file).read.split('# solution')
qu = UI.coderay(content[0])
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method start
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
system 'clear'
UI.puts "\nWelcome to #{'"Make all tests pass"'.light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
Method start
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"Don't ask me Ruby or Rails\"".light_cyan}"
UI.puts "Let's check whether you remember where Ruby ends and Rails\n"
Score.start
Method start
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def start
system 'clear'
UI.puts "\nWelcome to #{'"Make all tests pass"'.light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
- 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 start
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"What's the return value?\"".light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
Method start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"Don't ask me Ruby or Rails\"".light_cyan}"
UI.puts "Let's check whether you remember where Ruby ends and Rails\n"
Score.start
- 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 start
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def start
system 'clear'
UI.puts "\nWelcome to #{"\"What's the return value?\"".light_cyan}"
UI.puts "Let's check how much do you proficiency in ruby or rails\n"
Score.start
- 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
Block has too many lines. [26/25] Open
@questions.each.with_index(1) do |question, index|
UI.sleep_with_setting
self.index = index - 1
Score.init(index)
generate_file(index)
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.