Showing 32 of 47 total issues
Method generate_output
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def generate_output(count)
output = {}
if @aggregate == :all
c = count['all']
if c[:num] then output['num'] = c[:num] 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
File bootstrap-datepicker.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
Function fill
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
fill: function() {
var d = new Date(this.viewDate),
year = d.getFullYear(),
month = d.getMonth(),
currentDate = this.date.valueOf();
Method emit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def emit(tag, es, chain)
ntag, targets = @match_cache[tag]
unless targets
ntag = tag.sub(@prefix_match, @tag_prefix)
targets = []
- 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 click
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
click: function(e) {
e.stopPropagation();
e.preventDefault();
var target = $(e.target).closest('span, td, th');
if (target.length == 1) {
Method emit
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def emit(tag, es, chain)
messages = []
privmsg_messages = []
es.each {|time,record|
- 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 agent_opt_parse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def agent_opt_parse
hostnames = []
if ENV['LABEL']
hostnames = Feature.hostnames(ENV['LABEL'].split(","))
$stderr.puts 'LABEL does not exist' and exit unless hostnames.present?
- 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 receive_lines
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def receive_lines(lines)
lines.each do |line|
next if line == ""
case @line_number
when 0..1
Method included
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(controller)
controller.helpers do
def h(text)
Rack::Utils.escape_html(text)
Method emit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def emit(tag, es, chain)
min = nil
max = nil
sum = 0
num = 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 receive_lines
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def receive_lines(lines)
lines.each do |line|
next if line == ""
case @line_number
when 0..1
- 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 countups
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def countups(tag, min, max, sum, num, sample)
if @aggregate == :all
tag = 'all'
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 generate_output
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_output(count)
output = {}
if @aggregate == :all
c = count['all']
if c[:num] then output['num'] = c[:num] end
Method emit
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def emit(tag, es, chain)
messages = []
privmsg_messages = []
es.each {|time,record|
Method emit
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def emit(tag, es, chain)
ntag, targets = @match_cache[tag]
unless targets
ntag = tag.sub(@prefix_match, @tag_prefix)
targets = []
Method worker_deployed?
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def worker_deployed?(hostname)
hist = History.find_by(host: hostname, node_type: "worker")
if enabled?
return false if hist.nil? or hist.deployed_at.nil?
hist.deployed_at >= self.updated_at if self.updated_at
- 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 agent_deployed?
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def agent_deployed?(hostname)
hist = History.find_by(host: hostname, node_type: "agent")
if enabled?
return false if hist.nil? or hist.deployed_at.nil?
hist.deployed_at >= self.agent_updated_at if self.agent_updated_at
- 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 configure
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
super
if @remove_prefix
@removed_prefix_string = @remove_prefix + '.'
Method configure
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
super
@channel = '#' + @channel
@join_uri = URI.parse "http://#{@host}:#{@port}/join"
Function Datepicker
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Datepicker = function(element, options){
this.element = $(element);
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
this.picker = $(DPGlobal.template)
.appendTo('body')