Showing 18 of 2,428 total issues
Function render
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { config: siteConfig, language = '' } = this.props;
const { baseUrl } = siteConfig;
const Block = props => (
Function execute
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
execute(args, callback) {
let currentOptions;
let errorCode = 0;
try {
File config.test.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const path = require('path');
const cosmiconfig = require('cosmiconfig');
const Config = require('../../src/core/config/config');
Function render
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<footer className="nav-footer" id="footer">
<section className="sitemap">
<a href={this.props.config.baseUrl} className="nav-home">
Function base
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function base(results, rules) {
let output = `\n ${chalk.blue('Output')} \n\n`;
let summaryColor = 'yellow';
if (results.items.length === 0) {
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { siteConfig, language = '' } = this.props;
const { baseUrl, docsUrl } = siteConfig;
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
const langPart = `${language ? `${language}/` : ''}`;
Function runLifeCycle
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
async runLifeCycle(currentDirectory, verboseMode, reportCallback, asyncCallback) {
if (this.severity === SeverityEnum.Off) {
asyncCallback();
return;
}
Function _formatSchemaErrors
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_formatSchemaErrors(errors) {
const filteredRules = [];
return errors
.map(error => {
Function Help
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Help(props) {
const { config: siteConfig, language = '' } = props;
const { baseUrl, docsUrl } = siteConfig;
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
const langPart = `${language ? `${language}/` : ''}`;
Function _loadRules
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadRules() {
this.emit(EVENTS.ENGINE.LOAD_RULES);
const configRules = this.config.getRules();
Function constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(filePath = null, fileExplorer = null) {
this._config = null;
this._configFileExplorer = fileExplorer || cosmiconfig(MODULE_NAME);
- 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 onError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onError(exceptionError) {
if (typeof exceptionError.messageTemplate === 'string' && exceptionError.messageTemplate.length > 0) {
templateLoader.setTemplateId(exceptionError.messageTemplate);
const packageVersion = packageInfo.getVersion();
- 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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
execute(args, callback) {
let currentOptions;
let errorCode = 0;
try {
- 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
Avoid too many return
statements within this function. Open
return `"${field}" ${error.message} [${error.params.allowedValues}]`;
Avoid too many return
statements within this function. Open
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async run(sandbox) {
const files = await this._readRootDirectory();
const requiredFiles = this.context.options['required'];
if (requiredFiles) {
- 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 runLifeCycle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async runLifeCycle(currentDirectory, verboseMode, reportCallback, asyncCallback) {
if (this.severity === SeverityEnum.Off) {
asyncCallback();
return;
}
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
run(sandbox) {
const packagejson = this._getPackageJsonPath();
const requiredProps = this.context.options['required'];
if (requiredProps) {
- 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"