src/api/app/models/issue_tracker.rb
Class IssueTracker
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IssueTracker < ApplicationRecord
has_many :issues, dependent: :destroy
class NotFoundError < APIError
setup 'issue_tracker_not_found', 404, 'Issue Tracker not found'
Method parse_single_bugzilla_issue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parse_single_bugzilla_issue(bugzilla_response)
issue = Issue.find_by_name_and_tracker(bugzilla_response['id'].to_s, name)
return unless issue
issue.state = if bugzilla_response['is_open']
Method parse_single_bugzilla_issue
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
Open
def parse_single_bugzilla_issue(bugzilla_response)
issue = Issue.find_by_name_and_tracker(bugzilla_response['id'].to_s, name)
return unless issue
issue.state = if bugzilla_response['is_open']
- 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"