Showing 82 of 181 total issues
Function slide
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
Function 2
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
},{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
'use strict';
function oldAdd(element, className) {
var classes = element.className.split(' ');
- 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 client.post
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *client) post(method string, reqBody interface{}, respStruct interface{}) (interface{}, error) {
// Get the api base endpoint
apiBase := viper.Get("apiBase")
// Build the URL for the request
Function backdrop
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
Function show
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
Function activate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
Function parse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function(rawSchedule) {
// Set up the cron object
var schedule = this._schedule;
// Is it a special cron or not?
Method call
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
# Get an easier to work with request object
req = Rack::Request.new(env)
# Authenticate API requests using API keys
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
Function 2
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
'use strict';
function oldAdd(element, className) {
var classes = element.className.split(' ');
Method build_crontab
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_crontab(host)
# You have been warned..
crontab = "#\n"
crontab += "# This file was automatically generated by minicron at #{Time.now.utc}, DO NOT EDIT manually!\n"
crontab += "#\n\n"
- 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 add_server_cli_command
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.add_server_cli_command(cli)
cli.command :server do |c|
c.syntax = 'minicron server [start|stop|restart|status]'
c.description = 'Controls the minicron server.'
c.option '--host STRING', String, "The host for the server to listen on. Default: #{Minicron.config['server']['host']}"
- 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 bindMouseScrollXHandler
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindMouseScrollXHandler(element, i) {
var currentLeft = null;
var currentPageX = null;
function updateScrollLeft(deltaX) {
Function bindMouseScrollYHandler
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindMouseScrollYHandler(element, i) {
var currentTop = null;
var currentPageY = null;
function updateScrollTop(deltaY) {
Function _watch
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_watch: function() {
this._checkInit();
var self = this;
Function 4
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
},{}],4:[function(require,module,exports){
'use strict';
var EventElement = function (element) {
this.element = element;
- 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 1
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var ps = require('../main');
var psInstances = require('../plugin/instances');
Function applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
Function mousewheelHandler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mousewheelHandler(e) {
var delta = getDeltaFromEvent(e);
var deltaX = delta[0];
var deltaY = delta[1];
Function show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')