darrenli/jira-cli

View on GitHub

Showing 11 of 21 total issues

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

    def process(response, options)
      raise UnauthorizedException if response.status == 401
      body = response.body || {}
      json = (body if body.class == Hash) || {}
      if response.success? && json['errorMessages'].nil?
Severity: Minor
Found in lib/jira/api.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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def run
        return if metadata.empty?
        return if project.nil? || project.empty?
        return if project_metadata.empty?
        components # Select components if any after a project
Severity: Minor
Found in lib/jira/commands/new.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 rows has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def rows
        metadata['issues'].map do |issue|
          [
            issue['key'],
            (issue['fields']['assignee']['name'] unless issue['fields']['assignee'].nil?) || 'Unassigned',
Severity: Minor
Found in lib/jira/commands/tickets.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 params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def params
        {
          fields: {
            project:     { id: project['id'] },
            issuetype:   { id: issue_type['id'] },
Severity: Minor
Found in lib/jira/commands/new.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 subtasks_failure? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def subtasks_failure?
        return false unless subtask?
        if !metadata['fields']['subtasks'].empty? && !force
          self.force = io.yes?("Delete all sub-tasks for ticket #{ticket}?")
          return true unless force
Severity: Minor
Found in lib/jira/commands/delete.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def run
        return if ticket.empty?
        return if metadata.empty?
        return if issue_link_type.empty?
        return if outward_ticket.empty?
Severity: Minor
Found in lib/jira/commands/link.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

Avoid too many return statements within this method.
Open

        return if summary.empty?
Severity: Major
Found in lib/jira/commands/new.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return if assign_parent? && parent.empty?
    Severity: Major
    Found in lib/jira/commands/new.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return unless invalid_ticket?
      Severity: Major
      Found in lib/jira/commands/link.rb - About 30 mins to fix

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

              def run
                return if ticket.empty?
                return if metadata.empty?
                return unless metadata['errorMessages'].nil?
                return if transition.nil? || transition.empty?
        Severity: Minor
        Found in lib/jira/commands/transition.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

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

              def run
                return if ticket.empty?
                return if metadata.empty?
                return if metadata['fields'].nil?
        
        
        Severity: Minor
        Found in lib/jira/commands/attachments.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