Showing 21 of 30 total issues
Function index
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
function index(colors, product_query, org_query){
$.getJSON("/json/changes/donut/allchanges", function (json) {
function set_col() {
var cols = new Array();
for ( var x in json) {
Function bugzilla
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bugzilla(colors, product, bugzilla_url){
// BugZilla
product_ = product.replace(/_/g, " ");
$.getJSON("/json/bugzilla/" + product + "/trend/open", function (json) {
new Morris.Line({
File app.rb
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "sinatra/base"
require "sprockets"
require "haml"
require "json"
require "time"
Method get_change_requests
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_change_requests(state: 'open')
Nailed.logger.info("#{@origin}: #{__method__}")
Nailed::Config.all_repositories[@origin].each do |repo|
updated_changerequests = []
full_repo_name = "#{repo.organization.name}/#{repo.name}"
- 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 get_bugs
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_bugs
time = Time.now
@products.each do |product|
Nailed.logger.info("#{__method__}: Fetching bugs for #{product}")
components = Nailed::Config.components[product]
- 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 get_trends
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_trends(action, item)
call = "#{__method__}-#{action}-#{item})".to_sym
json = Nailed::Cache.get_cache(call)
return json unless json.nil?
Method get_change_requests
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_change_requests(state: 'open')
Nailed.logger.info("#{@origin}: #{__method__}")
Nailed::Config.all_repositories[@origin].each do |repo|
updated_changerequests = []
full_repo_name = "#{repo.organization.name}/#{repo.name}"
Method get_bugs
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_bugs
time = Time.now
@products.each do |product|
Nailed.logger.info("#{__method__}: Fetching bugs for #{product}")
components = Nailed::Config.components[product]
Method initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
logname = Nailed::Config.content["logfile"]
logfile = nil
case logname
when "stderr", "STDERR", "", nil
Method filter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def filter(data, datapoints = 40)
filtered = Hash.new
num = data.length/datapoints
data.first.keys.each do |key|
filtered[key] = data.each_slice(num.zero? ? num.succ : num)
- 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 get_jenkins_view_object
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_jenkins_view_object(job, parameter)
call = "#{__method__}-#{job}-#{parameter})".to_sym
view_object = Nailed::Cache.get_cache(call, 3600)
Method update_parameter_values
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_parameter_values
Nailed::Config.jobs.each do |job|
builds = get_builds(job)
builds.each do |build|
build_number = build["number"]
Method update_parameters
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_parameters
Nailed::Config.jobs.each do |job|
# first delete all old parameters
db_parameters = Jenkinsparameter.select(:name).where(job: job).map(&:name)
Method products
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def products
@@components = Hash.new
@@combined = Hash.new
products = load_content['products'].clone
products.each_with_index do |product, x|
- 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 get_label
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_label(product)
components = Nailed::Config.components[product]
label = components.nil? ? product : product + "/#{components.length > 1 ? 'subset' : components.fetch(0)}"
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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize
logname = Nailed::Config.content["logfile"]
logfile = nil
case logname
when "stderr", "STDERR", "", nil
- 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
Avoid too many return
statements within this function. Open
return '<span class="label label-info">' + priority + '</span>' ;
Avoid too many return
statements within this function. Open
return row.p5;
Avoid too many return
statements within this function. Open
return '<span class="label label-success">' + priority + '</span>' ;
Avoid too many return
statements within this function. Open
return row.p4;