Showing 189 of 189 total issues
File jquery-1.10.2.js
has 6641 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* jQuery JavaScript Library v1.10.2
* http://jquery.com/
*
* Includes Sizzle.js
File bootstrap.js
has 1596 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under the MIT license
*/
File captcha.js
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var keys = {
"0": [
["0", "0", "0", "1", "1", "1", "1", "0", "0", "0"],
["0", "1", "1", "1", "1", "1", "1", "1", "1", "0"],
["0", "1", "1", "1", "0", "0", "0", "1", "1", "0"],
Function ajax
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
Function setDocument
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setDocument = Sizzle.setDocument = function( node ) {
var doc = node ? node.ownerDocument || node : preferredDoc,
parent = doc.defaultView;
// If no document and documentElement is available, return
File colorchange.js
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
timeTableStorage = [{
"id": 0,
"name": "Table Default",
"data": [],
}];
Function init
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function () {
return this.each(function () {
var $element = $(this)
, $div
, $switchLeft
Function Callbacks
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
Consider simplifying this complex logical expression. Open
Open
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
Function support
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.support = (function( support ) {
var all, a, input, select, fragment, opt, eventName, isSupported, i,
div = document.createElement("div");
File bootstrap-checkbox-radio-switch.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
!function ($) {
/* CHECKBOX PUBLIC CLASS DEFINITION
* ============================== */
Function getCaptcha
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
var getCaptcha = function(img) {
temp = 0;
var x, y;
for (x = 0; x < 25; ++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
File bootstrap-notify.js
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Creative Tim Modifications
File bootstrap-select.js
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
!function($) {
var Selectpicker = function(element, options, e) {
if (e ) {
e.stopPropagation();
e.preventDefault();
Function defaultPrefilter
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, tween, hooks, oldfire,
anim = this,
orig = {},
Cyclomatic complexity is too high in function parseatt. (17) Open
Open
def parseatt(user):
page = open(user)
soup = BeautifulSoup(page, "html.parser")
page.close()
#print(soup.prettify())
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function trigger
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function( event, data, elem, onlyHandlers ) {
var handle, ontype, cur,
bubbleType, special, tmp, i,
eventPath = [ elem || document ],
type = core_hasOwn.call( event, "type" ) ? event.type : event,
Function Animation
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
Function send
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
Function init
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function (e) {
var _this = this;
this.$element.hide();
this.multiple = this.$element.prop('multiple');