Showing 6 of 6 total issues
Method install_languages
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_languages
case language
when "ascii"
puts <<-EOT
\n Installation instructures for ASCIIDoc:\n
Method build
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def build(new_attributes = nil, &block)
if block_given?
yield self
else
if !new_attributes.respond_to?(:stringify_keys)
- 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 validate!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate!(tempfile)
if self.class.max_size
raise FileTooBigError,
"File is too big. Max. size is #{self.class.max_size}" if tempfile.size > self.class.max_size
end
- 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 save!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save!
if self.file
fullname = Gollum::Page.cname(self.file.original_filename)
tempfile = self.file
validate! tempfile
Method find
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find(name, version=nil, folder_reset=false, exact=true)
name = name[:name] if name.kind_of?(Hash) && name.has_key?(:name)
Page.reset_folder if folder_reset
wiki.clear_cache
path = File.split(name)
- 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 save!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save!
if self.file
fullname = Gollum::Page.cname(self.file.original_filename)
tempfile = self.file
validate! tempfile
- 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"