Showing 204 of 440 total issues
Function nodeApiServiceFactory
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
workflowApiService,
waterline,
Errors,
Logger,
_,
Function Runner
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
constants,
HttpService,
core,
configuration,
profiles,
Function getVolume
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getVolume = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var index = req.swagger.params.index.value;
var volumeIndex = req.swagger.params.volumeIndex.value;
Function swaggerController
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function swaggerController(options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
Function listSelLogServiceEntries
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var listSelLogServiceEntries = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result){
Function validate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SchemaApiService.prototype.validate = function(obj, schemaName) {
return Promise.resolve().then(function() {
var basename;
// If a schemaName is specified, then validate against that
Function taskgraphApiServiceFactory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function taskgraphApiServiceFactory(
Errors,
configuration,
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
Function NodeFactory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function NodeFactory (
Promise,
Serializable,
ObmSerializable,
SnmpSerializable,
- 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 start
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function start() {
return core.start()
.then(function() {
return Promise.all([views.load()]);
})
Function getLcLogServiceEntry
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getLcLogServiceEntry = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var entryId = req.swagger.params.entryId.value;
return redfish.getVendorNameById(identifier)
Function swaggerSerdes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function swaggerSerdes(context, next) {
var serdesNameKey = fittingDef.serdesNameKey;
var operation = context.request.swagger.operation;
var serdesName;
var serdes;
Function create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function create(fittingDef, bagpipes) {
injector = require('../../index.js').injector;
var authz = injector.get('Http.Services.Api.Account');
var swaggerNodeRunner = bagpipes.config.swaggerNodeRunner;
var ready = loadSwagger(authz, swaggerNodeRunner.swagger);
Function getLocalEthernetInterface
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getLocalEthernetInterface = controller(function(req, res) {
var options = redfish.makeOptions(req, res);
var index = req.swagger.params.index.value;
return Promise.try(function() {
var net = _.get(os.networkInterfaces(), index);
Function generatePdf
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generatePdf(swaggerFile) {
fs.readFile(swaggerFile, {encoding: 'utf8'}, function (err, swaggerData) {
if (err) {
return console.log(err);
}
Function hookApiServiceFactory
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function hookApiServiceFactory(
waterline,
Logger,
_,
Errors,
Function onHttpContextFactory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onHttpContextFactory(di, directory) {
di = di || _di;
var core = onCore(di, directory),
helper = core.helper;
Function listManagerEthernetInterfaces
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var listManagerEthernetInterfaces = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var options = redfish.makeOptions(req, res, identifier);
return redfish.getVendorNameById(identifier)
Function taskApiServiceFactory
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
taskProtocol,
waterline,
Errors,
util,
configuration,
Function ibmsPatchById
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var ibmsPatchById = controller( function(req) {
var ibmId = req.swagger.params.identifier.value;
var values = req.swagger.params.body.value;
return waterline.ibms.needByIdentifier(ibmId)
.then(function(oldIbm) {
Function createSubscription
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var createSubscription = controller(function(req, res) {
var options = redfish.makeOptions(req, res);
var event = req.swagger.params.payload.value;
return redfish.validateSchema(event,
'EventDestination.v1_1_1.json#/definitions/EventDestination'