gabynaiman/git_wrapper

View on GitHub

Showing 5 of 7 total issues

Class Repository has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Repository
    attr_reader :location
    attr_reader :log_output
    attr_reader :log_error

Severity: Minor
Found in lib/git_wrapper/repository.rb - About 5 hrs to fix

    Method command has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def command
            command = 'branch '
    
            if @mode == :create
              command += "#{@name} #{@commit.nil? ? '' : @commit}"
    Severity: Minor
    Found in lib/git_wrapper/commands/branch.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 command has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def command
            command = "log -i --format=\"<log>#{xml_structure}</log>\""
            command += " #{@commit}" if @commit
            command += " --author \"#{@author}\"" if @author
            command += " --since \"#{@since}\"" if @since
    Severity: Minor
    Found in lib/git_wrapper/commands/log.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 command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def command
            command = "rev-list HEAD -i #{@count ? ' --count ' : ''}"
            command += " --author \"#{@author}\"" if @author
            command += " --since \"#{@since}\"" if @since
            command += " --until \"#{@until}\"" if @until
    Severity: Minor
    Found in lib/git_wrapper/commands/rev_list.rb - About 35 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 command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def command
            command = 'tag '
    
            if @mode == :create
              command += "#{@name} #{@commit.nil? ? '' : @commit}"
    Severity: Minor
    Found in lib/git_wrapper/commands/tag.rb - About 35 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