Showing 66 of 66 total issues
Function SwaggerResource
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SwaggerResource = function(resourceObj, api) {
var _this = this;
this.api = api;
this.api = this.api;
consumes = (this.consumes | []);
Function onOAuthComplete
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onOAuthComplete(token) {
if(token) {
if(token.error) {
var checkbox = $('input[type=checkbox],.secured')
checkbox.each(function(pos){
Function buildFromSpec
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
SwaggerApi.prototype.buildFromSpec = function(response) {
if (response.apiVersion != null) {
this.apiVersion = response.apiVersion;
}
this.apis = {};
Function buildFromSpec
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
SwaggerApi.prototype.buildFromSpec = function(response) {
if (response.apiVersion != null) {
this.apiVersion = response.apiVersion;
}
this.apis = {};
- 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 buildFrom1_1Spec
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
SwaggerApi.prototype.buildFrom1_1Spec = function(response) {
log("This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info");
if (response.apiVersion != null)
this.apiVersion = response.apiVersion;
this.apis = {};
Function addOperations
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
if (ops) {
output = [];
for (var i = 0; i < ops.length; i++) {
o = ops[i];
Function execute
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
ShredHttpClient.prototype.execute = function(obj) {
if(!this.isInitialized)
this.initShred();
var cb = obj.on, res;
Function SwaggerModelProperty
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var SwaggerModelProperty = function(name, obj) {
this.name = name;
this.dataType = obj.type || obj.dataType || obj["$ref"];
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;
- 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 handleLogin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function handleLogin() {
var scopes = [];
if(window.swaggerUi.api.authSchemes
&& window.swaggerUi.api.authSchemes.oauth2
- 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 SwaggerOperation
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
var SwaggerOperation = function(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations) {
Function complete
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
obj.complete = function(response, textStatus, opts) {
var headers = {},
headerArray = response.getAllResponseHeaders().split("\n");
for(var i = 0; i < headerArray.length; i++) {
Function build
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
SwaggerApi.prototype.build = function() {
var _this = this;
this.progress('fetching resource list: ' + this.url);
var obj = {
useJQuery: this.useJQuery,
Function SwaggerResource
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var SwaggerResource = function(resourceObj, api) {
var _this = this;
this.api = api;
this.api = this.api;
consumes = (this.consumes | []);
- 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 SwaggerModel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var SwaggerModel = function(modelName, obj) {
this.name = obj.id != null ? obj.id : modelName;
this.properties = [];
var propertyName;
for (propertyName in obj.properties) {
- 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 SwaggerModelProperty
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SwaggerModelProperty = function(name, obj) {
this.name = name;
this.dataType = obj.type || obj.dataType || obj["$ref"];
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;
Function urlify
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
SwaggerOperation.prototype.urlify = function(args) {
var url = this.resource.basePath + this.pathJson();
var params = this.parameters;
for(var i = 0; i < params.length; i ++){
var param = params[i];
Function keys
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Object.keys = Object.keys || (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
DontEnums = [
'toString',
Function help
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
SwaggerApi.prototype.help = function() {
var operation, operation_name, parameter, resource, resource_name, _i, _len, _ref, _ref1, _ref2;
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
- 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 SwaggerRequest
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
var SwaggerRequest = function(type, url, params, opts, successCallback, errorCallback, operation, execution) {
Function SwaggerApi
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var SwaggerApi = function(url, options) {
this.url = null;
this.debug = false;
this.basePath = null;
this.authorizations = null;
- 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"