Showing 64 of 133 total issues
File expandedmonitor.js
has 573 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define([
'view/base',
'view/deletemonitor',
'model/monitor',
'util/cron',
File addmonitor.js
has 553 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define([
'view/base',
'model/monitor',
'codemirror',
'util/cron',
File base.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define([
'jquery',
'underscore',
'backbone',
'handlebars',
File dashboard.js
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define([
'view/base',
'model/monitor',
'collection/monitor',
'view/smallmonitor',
Function Templar
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Backbone.Templar = function( templatePaths, options ) {
// if no options are passed
var options = ( typeof options === 'undefined' ) ? {} : options,
templateExtension = ( options.ext ) ? options.ext : config.ext,
baseUrlPath = ( options.url ) ? options.url : config.url,
File smallmonitor.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define([
'view/base'
], function(
BaseView
){
Function renderGraphData
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderGraphData : function(chart, graphData) {
var self = this,
renderData = graphData,
times = [],
colors = [ // creating an array to a series color scheme to stay consistant between updates from the server
Function setMetricsValidation
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setMetricsValidation : function() {
$.validator.addMethod('code', function(value, element) {
var mirror = $(element).data('CodeMirror'),
wrapper = $( mirror.getWrapperElement() );
return this._validateMirror(mirror);
Function addPopover
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addPopover : function() {
var self = this;
jobAlertIdList = _.uniq(self.jobAlertList);
for (var i = jobAlertIdList.length - 1; i >= 0; i--) {
Function initGraph
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initGraph : function(el) {
var self = this;
self.chart = new Highcharts.Chart({
exporting : {
Function updateMonitorList
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateMonitorList : function() {
// to store current list in current order
var monitorCollection = [],
renderCategories = [];
Function initPopover
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var initPopover = function(jobId) {
var $content = $("<div class='timeline-monitor'>"),
$closeBtn = $('<button/>', {
'text' : 'Troubleshoot Monitor',
Function setupDrag
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setupDrag : function() {
// drag-n-drop
this.$monitor.draggable({
handle : this.$el.find('.drag-handle'),
containment : 'body',
Function updateGraph
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateGraph : function(period) {
var runUpdate = false;
if ( !period ) {
runUpdate = true;
Function initMonitor
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initMonitor : function() {
var self = this;
// retrieve monitor model & graph data
self.getMonitor(self.monitorId, function(result) {
Function setupAlertTimeline
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setupAlertTimeline : function() {
var self = this,
jobAlertIdList = [];
$.ajax('/dashboards/' + self.dashboardId + '/errors', {
Function setHelp
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setHelp : function() {
var self = this,
$quickContent = '';
$alertContent = '';
$cronHelpContent = '';
Method make_constants_module
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def make_constants_module(*args)
mod_name = args[0]
mod_opts = args[1]
m = Module.new
constant_values = []
Method valid_alert_keys
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def valid_alert_keys
if alert_keys.present?
schemes = Rearview::Alerts.registry.keys
alert_keys.each do |key|
begin
- 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 metric_valid?
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def metric_valid?(metric)
valid = false
metric_key = nil
target_parser.parse(metric)
if target_parser.error?
- 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"