Showing 331 of 698 total issues
File index.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { ExtendedJSON, SessionManager } from '/client/imports/modules';
import { ReactivityProvider } from '/client/imports/facades';
import $ from 'jquery';
import Helper from '/client/imports/helpers/helper';
import { QueryRender } from '/client/imports/ui/querying';
Function prepareContextMenuItems
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareContextMenuItems({ addCollectionModal, convertToCappedModal, renameModal, validationRulesModal, filterModal, updateViewPipeline }) {
const self = this;
return {
manage_collection: {
name: Helper.translate({ key: 'manage' }),
File util.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Communicator, ReactivityProvider } from '/client/imports/facades';
import { SessionManager, ErrorHandler, Notification, Enums, Querying } from '/client/imports/modules';
import { CollectionAdd, CollectionValidationRules, CollectionRename, CollectionFilter, CollectionConversion, Connection, ViewPipelineUpdater } from '/client/imports/ui';
import Helper from '/client/imports/helpers/helper';
import $ from 'jquery';
File render.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Enums, ErrorHandler, Notification, SessionManager, UIComponents } from '/client/imports/modules';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { Communicator, ReactivityProvider } from '/client/imports/facades';
import Helper from '/client/imports/helpers/helper';
Function tickGenerator
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
axis.tickGenerator = function(axis) {
var ticks = [];
var d = dateGenerator(axis.min, opts);
var minSize = 0;
Function Colorpicker
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Colorpicker = function(element, options) {
this.element = $(element).addClass('colorpicker-element');
this.options = $.extend(true, {}, defaults, this.element.data(), options);
this.component = this.options.component;
this.component = (this.component !== false) ? this.element.find(this.component) : false;
Function parseOptions
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseOptions(opts) {
$.extend(true, options, opts);
// $.extend merges arrays, rather than replacing them. When less
File index.js
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { FlowRouter } from 'meteor/kadira:flow-router';
import { ReactivityProvider, Communicator } from '/client/imports/facades';
import { UIComponents, SessionManager, Notification, ErrorHandler } from '/client/imports/modules';
import $ from 'jquery';
import ConnectionHelper from './helper';
Function drawPie
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawPie() {
var startAngle = Math.PI * options.series.pie.startAngle;
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
Function initRules
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
initRules() {
const selectedCollection = $('#validationRulesModal').data('collection');
if (!selectedCollection) return;
const connection = ReactivityProvider.findOne(ReactivityProvider.types.Connections, { _id: SessionManager.get(SessionManager.strSessionConnection)._id });
- 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 plotLineArea
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function plotLineArea(datapoints, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
bottom = Math.min(Math.max(0, axisy.min), axisy.max),
i = 0, top, areaOpen = false,
Function setupTickGeneration
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupTickGeneration(axis) {
var opts = axis.options;
// estimate number of ticks
var noTicks;
Function insertLegend
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function insertLegend() {
if (options.legend.container != null) {
$(options.legend.container).html("");
} else {
File jquery.flot.time.js
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* Pretty handling of time axes.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Function register_observers
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Chosen.prototype.register_observers = function() {
var _this = this;
this.container.observe("touchstart", function(evt) {
_this.container_mousedown(evt);
return evt.preventDefault();
`` has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
Meteor.methods({
profilingInfo({ sessionId }) {
const methodArray = [
{
profilingInfo: [],
File helper.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { ReactivityProvider } from '/client/imports/facades';
import { SessionManager, UIComponents } from '/client/imports/modules';
import $ from 'jquery';
import Helper from '../../helpers/helper';
import { ReactiveVar } from 'meteor/reactive-var';
File index.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Database, Logger, Error } from '/server/imports/modules';
import ConnectionHelper from './helper';
const fs = require('fs');
const mongodbUrlParser = require('mongodb-url');
Function register_observers
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Chosen.prototype.register_observers = function() {
var _this = this;
this.container.bind('touchstart.chosen', function(evt) {
_this.container_mousedown(evt);
return evt.preventDefault();
Function drawBar
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
var left, right, bottom, top,
drawLeft, drawRight, drawTop, drawBottom,
tmp;