Showing 5 of 7 total issues
Method initilize
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def initilize(gutenberg,licence,ebook_number,title,author,illustrator,release_date,lang,charset,size)
Method dataMiner
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def dataMiner
wikidata = Hash.new
setHasArticle(false)
if(parsedPage=getParser)
if parsedPage["entities"].has_key?("-1") and parsedPage["entities"]["success"]="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 initilize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initilize(ebook_number,title,author,release_date,lang,size ,downloads)
Method bookresolver
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.bookresolver(bookid)
result = false
text = false
book=Book.find(bookid)
combination=["",0,8]
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.search(search)
if search
if search[:number]
find(:all, :conditions => ['number LIKE ?', "%#{search[:search]}%"])
elsif search[:title]
- 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"