Showing 18 of 38 total issues
Function Configuration
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Configuration = (function () {
function Configuration(options) {
this.raw = {};
this.set(require('../../defaults.browser.json'));
this.set(options);
Function Rule
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Rule = (function () {
function Rule(selectors, body) {
this.body = body;
this._selectors = [];
if (Array.isArray(selectors)) {
Function Rule
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
var Rule = (function () {
function Rule(selectors, body) {
this.body = body;
this._selectors = [];
if (Array.isArray(selectors)) {
- 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 Configuration
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
var Configuration = (function () {
function Configuration(options) {
this.raw = {};
this.set(require('../../defaults.browser.json'));
this.set(options);
- 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
Configuration
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Configuration implements ConfigurationOptions {
constructor(options?: ConfigurationOptions) {
this.set(require('../../defaults.browser.json'));
this.set(options);
Function Formatter
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Formatter = (function () {
function Formatter() {
}
Formatter.prototype.format = function (config, rules) {
if (typeof rules === 'undefined') {
Function Configuration
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Configuration = (function (_super) {
__extends(Configuration, _super);
function Configuration(options) {
_super.call(this, options);
this.set(require('../../defaults.json'));
Function Block
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Block = (function () {
function Block(name, body) {
this.name = name;
this.body = body;
}
Function Formatter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var Formatter = (function () {
function Formatter() {
}
Formatter.prototype.format = function (config, rules) {
if (typeof rules === 'undefined') {
- 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 Compiler
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Compiler = (function () {
function Compiler(config) {
this.config = config;
}
Compiler.prototype.compile = function (rules) {
Function resolveTree
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rule.prototype.resolveTree = function (selectors, body, seed, key) {
var _this = this;
seed = seed || {};
key = key || '';
Object.keys(body).forEach(function (k2) {
Function resolveTree
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private resolveTree(selectors: string, body: any, seed?: any, key?: string) {
seed = seed || {};
key = key || '';
Object.keys(body).forEach(k2 => {
if (k2 === 'respond') {
Function Modifier
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Modifier = (function () {
function Modifier(name, body) {
this.name = name;
this.body = body;
}
Function Element
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Element = (function () {
function Element(name, body) {
this.name = name;
this.body = body;
}
Function Configuration
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var Configuration = (function (_super) {
__extends(Configuration, _super);
function Configuration(options) {
_super.call(this, options);
this.set(require('../../defaults.json'));
- 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 compilePrimitive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private compilePrimitive(value: any) {
switch (typeof value) {
case 'number':
if (value === 0) {
return '0';
- 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 value;
Avoid too many return
statements within this function. Open
return value;