Showing 440 of 440 total issues
Function factory
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
function factory(assert, _, injector, Errors, Constants) {
function FileStreamer() {
this.injectorMap = {
FileSystem: 'Files.FS'
Function factory
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
function factory(Promise, Errors, waterline, uuid, assert, _, fs) {
fs = Promise.promisifyAll(fs);
function FileManager(config) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
if(result.vendor === 'Dell'){
options.type = 'LC';
options.description = 'iDRAC Lifecycle Controller Log';
options.name = 'idrac-lc-information';
options.log = {};
- 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 167.
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
if(result.vendor === 'Dell'){
options.type = 'SEL';
options.description = 'iDRAC System Event Log';
options.name = 'idrac-sel-information';
options.log = {};
- 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 167.
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 httpServiceFactory
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function httpServiceFactory(
eventsProtocol,
configuration,
lookupService,
swagger,
- 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 dataFactory
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
var dataFactory = function(identifier, dataName) {
switch(dataName) {
case 'catData':
return nodeApi.getNodeCatalogSourceById(identifier, 'ohai')
.then(function(catalog) {
Function NodeFactory
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
function NodeFactory (
Promise,
Serializable,
ObmSerializable,
SnmpSerializable,
Similar blocks of code found in 2 locations. Consider refactoring. Open
var getFirmwareInventoryList = controller({success: 200}, function (req, res) {
var options = redfish.makeOptions(req, res);
var matchComponent = "FRMW";
var keyMatch = Object.keys(fwPathsLookups);
return getVersions(options.url, keyMatch, matchComponent)
- 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 148.
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 getSoftwareInventoryList = controller({success: 200}, function (req, res) {
var options = redfish.makeOptions(req, res);
var matchComponent = "APAC";
var keyMatch = Object.keys(swPathsLookups);
return getVersions(options.url, keyMatch, matchComponent)
- 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 148.
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 pollerApiServiceFactory
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pollerApiServiceFactory(
waterline,
taskProtocol,
Errors,
_,
File update-service.js
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
'use strict';
var xmlParser = require('xml2js').parseString;
Function listSystemEthernetInterfacesById
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
var listSystemEthernetInterfacesById = controller(function(req, res) {
var identifier = req.swagger.params.identifier.value;
var index = req.swagger.params.index.value;
return redfish.getVendorNameById(identifier)
Function NotificationApiServiceFactory
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
function NotificationApiServiceFactory(
eventsProtocol,
Logger,
waterline,
Errors,
- 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 prepareGrunt
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareGrunt(grunt) {
var allFiles = [
'package.json',
'Gruntfile.js',
'lib/**/*.js',
File swagger-api-service.js
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright 2016, EMC, Inc.
'use strict';
var di = require('di');
Function selTranslator
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
var selTranslator = function(selArray, identifier) {
var dateRegex = /(\d{1,2})\/(\d{1,2})\/(\d{4})/;
var timeRegex = /(\d{1,2}):(\d{1,2}):(\d{1,2})/;
var ipmiEventTypeMap = {
'Asserted': 'Assert',
Function getChassis
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getChassis = controller(function(req, res) {
var chassisId = req.swagger.params.identifier.value.split('.')[0];
var systemId = req.swagger.params.identifier.value.split('.')[1];
var typeEnum = [
"Rack",
File http-service.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright 2015, EMC, Inc.
'use strict';
var di = require('di');
Function staticFilesApiServiceFactory
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function staticFilesApiServiceFactory(
constants,
Logger,
Promise,
configuration,
Function addVolume
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
var addVolume = controller(function(req,res) {
var identifier = req.swagger.params.identifier.value;
var payload = req.swagger.params.payload.value;
var graphName = 'Graph.Dell.Wsman.Add.Volume';
var graphOptions = {