jerrywdlee/yaml_2_resume

View on GitHub

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"
Severity: Minor
Found in lib/cv_maker.rb - About 2 hrs to fix

    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 == ""
    Severity: Minor
    Found in lib/txt2yaml.rb - About 1 hr to fix

    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"])
    Severity: Minor
    Found in lib/cv_maker.rb - About 1 hr to fix

      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"])
      Severity: Minor
      Found in lib/cv_maker.rb - About 45 mins to fix

      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)
      Severity: Minor
      Found in lib/cv_maker.rb - About 35 mins to fix

        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
        Severity: Minor
        Found in lib/cv_maker.rb - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language