Showing 17 of 29 total issues
Function exports
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
'use strict';
// Project configuration.
Function time_slots
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
var time_slots = this.evaluate(function () {
var nodes, slots = {};
// filter-out text nodes
Function displayPerformanceLineChart
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayPerformanceLineChart(where, percentile95data, percentile50data, volumeData) {
var xRange = [new Date(thisYear() - 1, 11, 29), new Date(thisYear() + 1, 0, 1)];
var y1Range = [0, 1.3 * d3.max(percentile95data, function(d) { return parseInt(d.y); })];
var y2Range = [0, 1.3 * d3.max(volumeData, function(d) { return parseInt(d.y); })];
Function displayHistogram
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayHistogram(where, dataSource, displayLines) {
var width, height, x, y, n, data, maxY, svg, bars, xAxis, medianValue, percentileValue;
width = 960 - margin.left - margin.right;
height = 500 - margin.top - margin.bottom;
Method compute_error
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def compute_error
return :unparseable unless parsed
return :domain_dot if domain_dot_error?
return :bad_domain if bad_domain?
return :malformed unless well_formed_address?
- 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"
Further reading
Function _createAutocomplete
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createAutocomplete: function(){
var selected = this.$select.children(':selected'),
val = selected.val() ? selected.text() : '',
key, value, i, attrs, raw_attrs;
Method refresh
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def refresh
@min_week = 55
@max_week = 0
hash_with_default = Hash.new { |h, k| h[k] = Array.new(52, 0) }
Function formatSeconds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function formatSeconds(s) {
var output = [],
d, h, m;
if (s === 0) {
- 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"
Further reading
Method booking_receipt_email
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def booking_receipt_email(visit, confirmation)
@visit = visit
@confirmation = confirmation
if confirmation.slot_selected?
Avoid too many return
statements within this method. Open
return :spam_reported if spam_reported?(parsed.address)
Avoid too many return
statements within this method. Open
return :bounced if bounced?(parsed.address)
Avoid too many return
statements within this method. Open
return :no_mx_record unless mx_records?
Method update_entry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_entry(visit_id)
entry = find_entry(visit_id)
if entry
yield entry
entry.save! if entry.changed?
- 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"
Further reading
Method validate_renewals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_renewals
if outcome == NO_ALLOWANCE
if no_vo.present? && renew_vo.blank?
errors.add(:no_vo, 'a renewal date must be chosen')
end
- 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"
Further reading
Method update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
visit.visitors = build_visitors
go_forward = visit.visitors.all?(&:valid?) && visit.valid?(:visitors_set)
- 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"
Further reading
Method create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
@feedback = Feedback.new(feedback_params)
@feedback.prison = prison_name if visit
if @feedback.valid?
- 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"
Further reading
Method parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(hash)
hash = hash.dup
raise ParseError.new("Missing subject") unless hash[:subject]
raise ParseError.new("Missing email body") unless hash[:text]
charsets = JSON.parse(hash[:charsets]).with_indifferent_access
- 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"