Showing 4 of 104 total issues
Class Server
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Server < Sinatra::Base
enable :static, :methodoverride
set :public_folder, Geminabox.public_folder
set :views, Geminabox.views
File server.rb
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Confirmed
Confirmed
require 'reentrant_flock'
require 'rubygems/util'
module Geminabox
Method reindex
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def reindex(force_rebuild = false)
fixup_bundler_rubygems!
force_rebuild = true unless Geminabox.incremental_updates
if force_rebuild
indexer.generate_index
- 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 <=>
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
def <=>(other)
sort = other.name <=> name
sort = version <=> other.version if sort.zero?
sort = (other.ruby? && !ruby?) ? 1 : -1 if sort.zero? && ruby? != other.ruby?
sort = other.platform <=> platform if sort.zero?
- 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"