Showing 204 of 440 total issues
Function workflowApiServiceFactory
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function workflowApiServiceFactory(
eventsProtocol,
Logger,
Errors,
Promise,
Function getFwCollections
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getFwCollections(fwTypeKeywords, catalogs) {
//Return a collection of the unique FW versions and its related components
var fwTypes = {};
_.forEach(catalogs, function (catalog) {
_.forEach(catalog, function (sources) {
Function authServiceFactory
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function authServiceFactory(
assert,
configuration,
_,
waterline
- 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 getSimpleStorage
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getSimpleStorage = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var index = req.swagger.params.index.value;
return redfish.getVendorNameById(identifier)
Function getThermal
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getThermal = controller(function(req, res) {
var chassisId = req.swagger.params.identifier.value.split('.')[0];
var systemId = req.swagger.params.identifier.value.split('.')[1];
return redfish.getVendorNameById(chassisId)
Function registerPack
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
SkuPackService.prototype.registerPack = function(skuId, contents) {
var promises = [];
var self = this;
var skuRoot = self.confRoot + '/' + skuId;
Function create
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function create(fittingDef) {
var validate = validator();
return function swagger_validator(context, next) { // jshint ignore:line
if (!context.response.headersSent) {
var schemaNameKey = fittingDef.schemaNameKey;
- 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 getStorage
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getStorage = controller(function (req, res) {
var identifier = req.swagger.params.identifier.value;
var index = req.swagger.params.index.value;
return redfish.getVendorNameById(identifier)
Function getPower
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getPower = controller(function(req, res) {
var chassisId = req.swagger.params.identifier.value.split('.')[0];
var systemId = req.swagger.params.identifier.value.split('.')[1];
return redfish.getVendorNameById(chassisId)
Function UPnPServiceFactory
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function UPnPServiceFactory(
_,
waterline,
Logger,
Profiles,
- 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 notification-api-service.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
'use strict';
var di = require('di');
File event-service.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright 2016, EMC, Inc.
'use strict';
var urlParse = require('url-parse');
var injector = require('../../../index.js').injector;
Function create
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function create(fittingDef, bagpipes) {
var swaggerNodeRunner = bagpipes.config.swaggerNodeRunner;
var appRoot = swaggerNodeRunner.config.swagger.appRoot;
var serdesDirs = fittingDef.serdesDirs.map(function(dir) {
return path.resolve(appRoot, dir);
- 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 listManagerNetworkProtocol
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
var listManagerNetworkProtocol = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var options = redfish.makeOptions(req, res, identifier);
return redfish.getVendorNameById(identifier)
Function SshFactory
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SshFactory (Promise, Serializable, encryption) {
function Ssh (defaults) {
Serializable.call(this, Ssh.schema, defaults);
}
Function doReset
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
var doReset = controller(function(req,res) {
//TODO Fix for node types
var identifier = req.swagger.params.identifier.value;
var payload = req.swagger.params.payload.value;
var options;
Function schemaApiServiceFactory
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function schemaApiServiceFactory(
configuration,
Logger,
Promise,
_,
- 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 account-api-service.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright 2016, EMC, Inc.
'use strict';
var di = require('di'),
Function httpEventMiddleware
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function httpEventMiddleware(req, res, next) {
req._startAt = process.hrtime();
res.locals.ipAddress = remoteAddress(req);
res.locals.scope = ['global'];
res.locals.uuid = uuid.v4();
Function wsmanServiceFactory
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wsmanServiceFactory(
waterline,
encryption,
configuration,
WsmanTool,