Showing 8 of 8 total issues

Method parse has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  def self.parse(log_s)
    cur = nil
    inmessage = false
    gitlogs = []

Severity: Minor
Found in lib/wlog/tech/git_commit_parser.rb - About 2 hrs 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 longtext has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  def longtext
    if ENV['EDITOR'].nil?
      count = 0
      status = nil
      str = ""
Severity: Minor
Found in lib/wlog/ui/invoice_ui.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 change has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def change
    create_table :issues do |t|
      t.text :description
      t.datetime :due_date
      t.integer :status
Severity: Minor
Found in lib/wlog/migrations/make_standard_tables.rb - About 1 hr to fix

    Method parse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.parse(log_s)
        cur = nil
        inmessage = false
        gitlogs = []
    
    
    Severity: Minor
    Found in lib/wlog/tech/git_commit_parser.rb - About 1 hr to fix

      Method run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def run
          cmd = "default"
          until cmd == "end" do
            cmd = Readline.readline("[issue ##{@issue.id}] ") || ""
            cmd.chomp!
      Severity: Minor
      Found in lib/wlog/ui/issue_ui.rb - About 55 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 delete_issue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def delete_issue(cmd)
          issue_id = cmd.split[1]
      
          if !issue_id
            puts 'usage:'
      Severity: Minor
      Found in lib/wlog/ui/cli_interface.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def run
          cmd = "default"
      
          until cmd == "end" do
            cmd = Readline.readline("[#{@strmaker.blue('git')}] ")
      Severity: Minor
      Found in lib/wlog/ui/git_ui.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 focus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def focus(cmd)
          issue_id = cmd.split[1]
          if !issue_id
            puts 'usage: '
            puts '  focus <id>'
      Severity: Minor
      Found in lib/wlog/ui/cli_interface.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