Showing 51 of 85 total issues
File es5-shim.js
has 1509 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
File marked.js
has 901 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* marked - a markdown parser
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
* https://github.com/chjj/marked
*/
Function token
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Lexer.prototype.token = function(src, top, bq) {
var src = src.replace(/^ +$/gm, '')
, next
, loose
, cap
Function handleLogin
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleLogin() {
var scopes = [];
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
if(auths) {
Function handleLogin
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
function handleLogin() {
var scopes = [];
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
if(auths) {
- 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 output
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
InlineLexer.prototype.output = function(src) {
var out = ''
, link
, text
, href
Function tok
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.tok = function() {
switch (this.token.type) {
case 'space': {
return '';
}
File swagger-oauth.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var appName;
var popupMask;
var popupDialog;
var clientId;
var realm;
Function marked
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function marked(src, opt, callback) {
if (callback || typeof opt === 'function') {
if (!callback) {
callback = opt;
opt = null;
Consider simplifying this complex logical expression. Open
Open
if (match) {
// parse months, days, hours, minutes, seconds, and milliseconds
// provide default values if necessary
// parse the UTC offset component
var year = $Number(match[1]),
Function toFixed
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var toFixedShim = function toFixed(fractionDigits) {
var f, x, s, m, e, z, j, k;
// Test for NaN and round fractionDigits down
f = $Number(fractionDigits);
Function splice
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
splice: function splice(start, deleteCount) {
var O = ES.ToObject(this);
var A = [];
var len = ES.ToUint32(O.length);
var relativeStart = ES.ToInteger(start);
Function split
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
StringPrototype.split = function (separator, limit) {
var string = String(this);
if (typeof separator === 'undefined' && limit === 0) {
return [];
}
Function onOAuthComplete
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) {
if(token) {
if(token.error) {
var checkbox = $('input[type=checkbox],.secured')
checkbox.each(function(pos){
Consider simplifying this complex logical expression. Open
Open
if (
hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
minute < 60 && second < 60 && millisecond < 1000 &&
month > -1 && month < 12 && hourOffset < 24 &&
minuteOffset < 60 && // detect invalid offsets
Function parse
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var parseShim = function parse(string) {
var match = isoDateExpression.exec(string);
if (match) {
// parse months, days, hours, minutes, seconds, and milliseconds
// provide default values if necessary
Function bind
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
bind: function bind(that) { // .length is 1
// 1. Let Target be the this value.
var target = this;
// 2. If IsCallable(Target) is false, throw a TypeError exception.
if (!isCallable(target)) {
Function reduceRight
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reduceRight: function reduceRight(callbackfn/*, initial*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
Function keys
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keys: function keys(object) {
var isFn = isCallable(object);
var isArgs = isArguments(object);
var isObject = object !== null && typeof object === 'object';
var isStr = isObject && isString(object);
Function reduce
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reduce: function reduce(callbackfn/*, initialValue*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);