Showing 6 of 11 total issues
File cv_maker.rb
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "mini_magick"
require "open-uri"
require "prawn"
require "wareki"
require "yaml"
Method convert
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def convert(style_txt)
data = []
style_txt.lines.each do |line|
next if line =~ /^#/
next if line.chomp == ""
- 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 education_experience
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def education_experience(h)
y = size(h["y"])
year_x = size(h["year_x"])
month_x = size(h["month_x"])
value_x = size(h["value_x"])
Method lines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def lines(h)
line_style(h)
points = h["points"]
x = size(points[0]["x"])
y = size(points[0]["y"])
- 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 put_string
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def put_string(x, y, str, font_size, font_face)
Method line_style
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def line_style(h)
if h.has_key?("line_style")
case h["line_style"]
when "solid"
undash
- 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"