Showing 5 of 5 total issues
Class Report
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Report < ActiveRecord::Base
serialize :basic_distribution, Hash
serialize :pr_distribution, Hash
serialize :issues_distribution, Hash
- Create a ticketCreate a ticket
Method badge_values
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def badge_values(variant, concise=false)
duration = send("#{variant}_close_time")
index = Issue.duration_index(duration)
if variant == 'pr'
- Read upRead up
- Create a ticketCreate a ticket
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 bootstrap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def bootstrap
day_split = 8.0
setup_distributions
self.issues_count = 0
durations = []
- Create a ticketCreate a ticket
Method language_highchart
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def language_highchart(pr_values, issues_values, languages)
LazyHighCharts::HighChart.new('graph') do |f|
f.title(:text => "Responsiveness by Language")
f.series name: "Pull Requests", data: pr_values
f.series name: "Issues", data: issues_values
- Create a ticketCreate a ticket
Method duration_tier_from_duration
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def duration_tier_from_duration(duration)
return 0 unless duration
duration_tiers.each_with_index do |tier, index|
last_tier = index == 0 ? 0 : Issue.duration_tiers[index - 1]
if (duration <= tier) && (duration > last_tier)
- Read upRead up
- Create a ticketCreate a ticket
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"