Showing 30 of 30 total issues
File ApacheSyntax.js
has 620 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @license
*
* Copyright 2016- Luke Jones (https://github.com/luke-j)
*
File NginxSyntax.js
has 598 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @license
*
* Copyright 2016- Luke Jones (https://github.com/luke-j)
*
Function proxy
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
proxy() {
const expression = {
expressions: []
};
Function fastcgi
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fastcgi() {
const expression = {
expressions: []
};
Function _deepAssign
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
_deepAssign(target, source) {
const deeplyAssigned = {};
for (const option in target) {
if (target.hasOwnProperty(option)) {
if (source.hasOwnProperty(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"
Further reading
Function proxy
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
proxy() {
const expression = {
expressions: []
};
Function compress
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compress() {
const expression = {
expressions: []
};
Function constructor
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(type, server, config) {
this._defaults = {
name: server,
ssl: {
enable: false,
Function auth
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
auth() {
const expression = {
expressions: []
};
Function fastcgi
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fastcgi() {
const expression = {
expressions: []
};
Function caching
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
caching() {
const expression = {
expressions: []
},
minutesInOneYear = 525600;
Function headers
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
headers() {
const expression = {
expressions: []
};
Function checkValidity
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkValidity(expression) {
switch (expression.type) {
case 'AssignmentExpression':
expect(expression.left).to.exist;
expect(expression.right).to.exist;
Function headers
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
headers() {
const expression = {
expressions: []
};
Function caching
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
caching() {
const expression = {
expressions: []
};
Function compress
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compress() {
const expression = {
expressions: []
};
Function ssl
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ssl() {
const expression = {
expressions: []
};
Function _expression
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_expression(expression) {
if (!expression.hasOwnProperty('type')) {
throw new Error('Expression must have a type');
}
Function _parseLocations
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
_parseLocations(config) {
const locations = {};
for (const option in config) {
if (config.hasOwnProperty(option)) {
// locations must be objects
- 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 checkValidity
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkValidity(expression) {
switch (expression.type) {
case 'AssignmentExpression':
expect(expression.left).to.exist;
expect(expression.right).to.exist;