Showing 30 of 30 total issues
Function ssl
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ssl() {
const expression = {
expressions: []
};
Function auth
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
auth() {
const expression = {
expressions: []
};
Function listDirectories
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
listDirectories() {
return {
expressions: [
{
type: 'LocationBlock',
Function redirect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
redirect() {
const expression = {
expressions: []
};
Function _buildConf
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_buildConf(server) {
const config = new Config(this._use, server, this._config[server]);
let builder;
switch (this._use) {
Function _expression
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_expression(expression) {
if (!expression.hasOwnProperty('type')) {
throw new Error('Expression must have a type');
}
Function main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static main(scriptArgs = []) {
const args = {};
for (let x = 0, length = scriptArgs.length; x < length; x += 2) {
args[scriptArgs[x].replace(/^\-{2}/, '')] = scriptArgs[x + 1];
}
Function headers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
headers() {
const expression = {
expressions: []
};
- 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 main
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static main(scriptArgs = []) {
const args = {};
for (let x = 0, length = scriptArgs.length; x < length; x += 2) {
args[scriptArgs[x].replace(/^\-{2}/, '')] = scriptArgs[x + 1];
}
- 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 _compileContext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_compileContext(context) {
for (const option in context.Config.options) {
if (context.Config.options.hasOwnProperty(option)) {
if (typeof context.Syntax[option] !== 'function') {
SpiderMonkey.print(`Invalid option "${option}"`);
- 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"