File buildable.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Treat::Entities::Entity::Buildable
require 'schiphol'
require 'fileutils'
require 'uri'
Method build
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def build(*args)
# This probably needs some doc.
if args.size == 0
file_or_value = ''
- 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 from_folder
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def from_folder(folder)
return if Reserved.include?(folder)
unless FileTest.directory?(folder)
- 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 build
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build(*args)
# This probably needs some doc.
if args.size == 0
file_or_value = ''
Method anything_from_string
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def anything_from_string(string)
case self.mn.downcase.intern
when :document
folder = Treat.paths.files
if folder[-1] == '/'
Method from_folder
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from_folder(folder)
return if Reserved.include?(folder)
unless FileTest.directory?(folder)
Method token_from_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def token_from_string(string)
check_encoding(string)
if Enclitics.include?(string.downcase)
Treat::Entities::Enclitic.new(string)
- 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 anything_from_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def anything_from_string(string)
case self.mn.downcase.intern
when :document
folder = Treat.paths.files
if folder[-1] == '/'
- 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 from_serialized_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_serialized_file(file)
unless File.readable?(file)
raise Treat::Exception,
"Path '#{file}' does not "+
- 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"