Showing 269 of 269 total issues
Function _printHelp
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
_printHelp(commandOptions, rawArgs) {
let rootCommand = new RootCommand({
ui: this.ui,
project: this.project,
commands: this.commands,
- Read upRead up
- Create a ticketCreate a ticket
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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async run(commandOptions) {
let hasBuild = !!commandOptions.path;
let outputPath;
if (hasBuild) {
- Read upRead up
- Create a ticketCreate a ticket
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 findLCAHost
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
findLCAHost(engineInstance) {
// only compute once for a given engine
// we're using the engine name as the cache key here because regardless of its
// version, lazy engines will always get output to: `engines-dist/${engineName}`
let lcaHost = this._lcaHostCache.get(engineInstance.name);
- Create a ticketCreate a ticket
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(defaults, options) {
if (arguments.length === 0) {
options = {};
} else if (arguments.length === 1) {
options = defaults;
- Create a ticketCreate a ticket
Function throwFormattedBroccoliError
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
throwFormattedBroccoliError(err) {
// TODO fix ember-cli/console-ui to handle current broccoli broccoliPayload
let broccoliPayload = err && err.broccoliPayload;
if (broccoliPayload) {
if (!broccoliPayload.error) {
- Create a ticketCreate a ticket
Function _fileSystemInfo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_fileSystemInfo() {
if (this._cachedFileSystemInfo) {
return this._cachedFileSystemInfo;
}
- Create a ticketCreate a ticket
Function serverMiddleware
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
serverMiddleware(options) {
let app = options.app;
options = options.options;
let broccoliMiddleware = options.middleware || require('broccoli-middleware').watcherMiddleware;
- Create a ticketCreate a ticket
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options) {
this._cachedTests = null;
this._cachedVendor = null;
this._cachedPublic = null;
this._cachedConfig = null;
- Create a ticketCreate a ticket
Function _getBundledPackageInfos
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getBundledPackageInfos(pkgInfoToStartAt) {
let pkgInfos = this._bundledPackageInfoCache.get(pkgInfoToStartAt);
if (pkgInfos) {
return pkgInfos;
- Create a ticketCreate a ticket
Function stopAndReport
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
stopAndReport(name) {
if (!instrumentationEnabled(this.config)) {
return;
}
- Create a ticketCreate a ticket
Function isExperimentEnabled
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isExperimentEnabled(experimentName) {
if (!availableExperiments.includes(experimentName)) {
return false;
}
- Create a ticketCreate a ticket
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options) {
this.isVizEnabled = vizEnabled;
this.isEnabled = instrumentationEnabled;
this.ui = options.ui;
- Create a ticketCreate a ticket
Function treeFor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
treeFor(treeType) {
let node = heimdall.start({
name: `treeFor(${this.name} - ${treeType})`,
addonName: this.name,
treeType,
- Create a ticketCreate a ticket
Function getPackageBlueprints
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPackageBlueprints(collection, options, singleBlueprintName) {
let verbose = options.verbose;
let blueprints = collection.blueprints;
if (!verbose) {
- Create a ticketCreate a ticket
Function getAllBlueprints
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
getAllBlueprints(options) {
let lookupPaths = this.project.blueprintLookupPaths();
let blueprintList = Blueprint.list({ paths: lookupPaths });
let output = '';
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (commandOptions.in) {
let relativePath = path.relative(this.project.root, commandOptions.in);
commandOptions.in = path.resolve(relativePath);
}
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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
if (arguments.length === 0) {
options = {};
} else if (arguments.length === 1) {
options = defaults;
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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
if (arguments.length === 0) {
options = {};
} else if (arguments.length === 1) {
options = defaults;
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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 (!fs.existsSync(this.startOptions.sslKey)) {
throw new TypeError(
`SSL key couldn't be found in "${this.startOptions.sslKey}", ` +
`please provide a path to an existing ssl key file with --ssl-key`
);
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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 (!fs.existsSync(this.startOptions.sslCert)) {
throw new TypeError(
`SSL certificate couldn't be found in "${this.startOptions.sslCert}", ` +
`please provide a path to an existing ssl certificate file with --ssl-cert`
);
- Read upRead up
- Create a ticketCreate a ticket
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 58.
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