Showing 31 of 676 total issues
Avoid too many return
statements within this function. Open
if (distance_in_minutes < 2880) { return '1 day ago'; }
Avoid too many return
statements within this function. Open
if (distance_in_minutes < 1440) { return Math.floor(distance_in_minutes / 60) + ' hours ago'; }
Avoid too many return
statements within this function. Open
return 'over ' + Math.floor(distance_in_minutes / 525960) + ' years ago';
Avoid too many return
statements within this function. Open
if (distance_in_minutes < 1051199) { return 'about 1 year ago'; }
Avoid too many return
statements within this function. Open
if (distance_in_minutes < 43200) { return Math.floor(distance_in_minutes / 1440) + ' days ago'; }
Avoid too many return
statements within this method. Open
return :conflict if e.err[/\[rejected\]/]
Avoid too many return
statements within this function. Open
if (distance_in_minutes < 525960) { return Math.floor(distance_in_minutes / 43200) + ' months ago'; }
Avoid too many return
statements within this function. Open
if (distance_in_minutes < 86400) { return '1 month ago'; }
Method for_push
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def for_push(result)
return if result.nil?
return if result == :no_remote
return if result == :nothing
- 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 status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def status
say "GitDoc v#{VERSION}"
say "Running: #{running?}"
say "File System Watch Method: #{Gitdocs::Manager.listen_method}"
say 'Watched repositories:'
- 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 synchronize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def synchronize(type)
result = { merge: nil, push: nil }
return result unless valid?
case type
- 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"