Showing 16 of 51 total issues
Function visitor
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function visitor(context) {
const t = context.types;
return {
Program: {
Function visitor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function visitor(context) {
const t = context.types;
return {
Program: {
- 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 CallExpression
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
CallExpression(path) {
if (!t.isIdentifier(path.node.callee, { name: this.cssInJS.options.identifier })) {
return;
}
Function processProperty
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function processProperty(key, value, result, context) {
const name = keyToName(key);
if (canEvaluate(value, context)) {
const val = context.evaluate(value);
- 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 processMediaQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function processMediaQuery(css, name, query, content, level, parent, options) {
Function processRules
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function processRules(css, name, rules, level, parent, options) {
Function processMediaQueries
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function processMediaQueries(css, name, mediaQueries, level, parent, options) {
Function canEvaluate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function canEvaluate(expr, context) {
if (t.isLiteral(expr)) {
return true;
} else if (t.isIdentifier(expr) && context.hasOwnProperty(expr.name)) {
return true;
- 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 processStyle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function processStyle(css, name, spec, level, parent, options) {
Function processStyleAndMediaQueryAndSelector
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function processStyleAndMediaQueryAndSelector(styles, styleName, mediaQueryName, selectorName, content, parent) {
Function processSelectors
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function processSelectors(css, name, selectors, level, parent, options) {
Function processParents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function processParents(css, name, parents, level, options) {
Function processStyleAndMediaQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function processStyleAndMediaQuery(styles, styleName, mediaQueryName, content, parent) {
Function processStyleAndSelector
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function processStyleAndSelector(styles, styleName, selectorName, content, parent) {
Avoid too many return
statements within this function. Open
return false;
Function buildCSS
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function buildCSS(stylesheets, options) {
let css = '';
foreach(stylesheets, (stylesheet, name) => {
const cssOptions = extend({}, 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"