Showing 27 of 62 total issues
File bootstrap-slider.js
has 1624 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*! =========================================================
* bootstrap-slider.js
*
* Maintainers:
* Kyle Kemp
Function Modernizr
has 605 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.3',
Modernizr = {},
Function Modernizr
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
Open
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.3',
Modernizr = {},
- 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 createNewSlider
has 372 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createNewSlider(element, options) {
/*
The internal state object is used to store data about the current 'state' of slider.
This includes values such as the `value`, `enabled`, etc...
Function exports
has 307 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var packageJSON = grunt.file.readJSON('package.json');
var bumpFiles = ["package.json", "bower.json", "composer.json"];
var commitFiles = bumpFiles.concat(["./dist/*"]);
File modernizr.js
has 607 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Modernizr v2.8.3
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
Function _layout
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_layout: function() {
var positionPercentages;
var formattedValue;
if(this.options.reversed) {
File Gruntfile.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*global module:false*/
module.exports = function(grunt) {
var packageJSON = grunt.file.readJSON('package.json');
var bumpFiles = ["package.json", "bower.json", "composer.json"];
Function _keydown
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_keydown: function(handleIdx, ev) {
if(!this._state.enabled) {
return false;
}
Function defineBridget
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function defineBridget( $ ) {
// bail if no jQuery
if ( !$ ) {
return;
Function setValue
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setValue: function(val, triggerSlideEvent, triggerChangeEvent) {
if (!val) {
val = 0;
}
var oldValue = this.getValue();
Function _removeSliderEventHandlers
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_removeSliderEventHandlers: function() {
// Remove keydown event listeners
this.handle1.removeEventListener("keydown", this.handle1Keydown, false);
this.handle2.removeEventListener("keydown", this.handle2Keydown, false);
Function _mousedown
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mousedown: function(ev) {
if(!this._state.enabled) {
return false;
}
Function bridge
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bridge( namespace, PluginClass ) {
// add to jQuery fn namespace
$.fn[ namespace ] = function( options ) {
if ( typeof options === 'string' ) {
// call plugin method when first argument is a string
Function namespace
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn[ namespace ] = function( options ) {
if ( typeof options === 'string' ) {
// call plugin method when first argument is a string
// get arguments for method
var args = slice.call( arguments, 1 );
Function webforms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function webforms() {
/*>>input*/
// Run through HTML5's new input attributes to see if the UA understands any.
// We're using f which is the <input> element created early on
// Mike Taylr has created a comprehensive resource for testing these attributes
Function injectElementWithStyles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node, docOverflow,
div = document.createElement('div'),
// After page load injecting a fake body doesn't work so check if body exists
Function _addTickListener
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_addTickListener: function _addTickListener() {
return {
addMouseEnter: function(reference, element, index){
var enter = function(){
let tempState = reference._copyState();
Function _setTooltipPosition
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setTooltipPosition: function(){
var tooltips = [this.tooltip, this.tooltip_min, this.tooltip_max];
if (this.options.orientation === 'vertical'){
var tooltipPos;
if(this.options.tooltip_position) {
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Function.prototype.bind = function bind(that) {
var target = this;
if (typeof target != "function") {