Showing 440 of 440 total issues
Function getSelLogService
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getSelLogService = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
return redfish.getVendorNameById(identifier)
.then(function(result){
Function UPnPService
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function UPnPService(options) {
this.options = options || {};
this.options.ssdpSig = 'node.js/' + nodeVersion + ' uPnP/1.1 on-http';
this.options.ssdpTtl = 2;
this.northbound = _.filter(configuration.get('httpEndpoints', []),
Similar blocks of code found in 2 locations. Consider refactoring. Open
var profilesPutLibByName = controller({success: 201}, function(req) {
return profilesApiService.profilesPutLibByName(req.swagger.params.name.raw, req, req.swagger.query.scope);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
var templatesLibPut = controller({success: 201}, function(req) {
return templateApiService.templatesLibPut(req.swagger.params.name.raw, req, req.swagger.query.scope);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function create
has 42 lines of code (exceeds 25 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);
Function profileApiServiceFactory
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function profileApiServiceFactory(
Promise,
Logger,
Errors,
_,
Function create
has 41 lines of code (exceeds 25 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;
Function createHttpProxy
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createHttpProxy(app, httpProxy){
var sep = path.sep; //The platform-specific file separator. '\\' or '/'
try {
var localPath = httpProxy.localPath || sep,
remotePath = httpProxy.remotePath || sep,
Function templateApiServiceFactory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function templateApiServiceFactory(
Promise,
Errors,
_,
taskgraphService,
Function error_handler
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function error_handler(context, next) { // jshint ignore:line
if (!util.isError(context.error)) { return next(); }
var err = context.error;
var ERROR_STATUS = 400;
Function start
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
AccountApiService.prototype.start = function() {
var acl = this.acl;
var self = this;
var endpoints = configuration.get('httpEndpoints', []);
var authEnabled = _(endpoints).filter(function(endpoint) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
return Promise.try(function() {
if(!req.isAuthenticated || !req.isAuthenticated()) {
throw new Errors.UnauthorizedError('Unauthorized');
}
return accountService.getUserByName(name);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
return Promise.try(function() {
if(!req.isAuthenticated || !req.isAuthenticated()) {
throw new Errors.UnauthorizedError('Unauthorized');
}
return accountService.getUserByName(name);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function redfishApiServiceFactory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function redfishApiServiceFactory(
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
Function setSecureBoot
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setSecureBoot = controller(function(req, res) {
//TODO Write logic for non racadm
var identifier = req.swagger.params.identifier.value;
var options = redfish.makeOptions(req, res, identifier);
var graphName = 'Graph.Dell.Wsman.ConfigureBios';
Function unregisterPack
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
SkuPackService.prototype.unregisterPack = function(skuid, conf) {
var promises = [];
var self = this;
var skuRoot = self.confRoot + '/' + skuid;
var cleanup;
Function getFile
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
FileStreamer.prototype.getFile = function(req, res, id) {
var self = this;
var uuidFound;
if (id.match(Constants.Regex.uuid)) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
return Promise.resolve().then(function() {
assert.string(tagName, 'tag must be a string');
})
.then(function() {
return waterline.nodes.findByTag(tagName);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
return Promise.resolve().then(function() {
assert.isMongoId(id, 'the id must be a valid mongo id');
})
.then(function() {
return waterline.nodes.needByIdentifier(id);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function swagger_validator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function swagger_validator(context, next) { // jshint ignore:line
if (!context.response.headersSent) {
var schemaNameKey = fittingDef.schemaNameKey;
var operation = context.request.swagger.operation;
var schemaName = operation[schemaNameKey];