Showing 15 of 20 total issues
Function tokenize
has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring. Open
export function tokenize(
input: Input & { error: (message: string, pos?: number) => void },
options: TokenizeOptions = {},
): Tokenizer {
const css = input.css.valueOf();
- 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 tokenize
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function tokenize(
input: Input & { error: (message: string, pos?: number) => void },
options: TokenizeOptions = {},
): Tokenizer {
const css = input.css.valueOf();
Function nextToken
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
function nextToken(opts?: { ignoreUnclosed?: boolean }): Token | void {
if (returned.length > 0) return returned.pop();
if (pos >= len) return undefined;
const ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
Function exports
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async (src, dest, opts) => {
// Load user defined config or fall back to default file locations
const result = await joycon.load(opts.config ? [opts.config] : undefined);
if (!result.path && !opts.quiet) {
File config.js
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck 😢
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-return */
Function exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = async (src, dest, opts) => {
// Load user defined config or fall back to default file locations
const result = await joycon.load(opts.config ? [opts.config] : undefined);
if (!result.path && !opts.quiet) {
- 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
File tokenize.ts
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Based on https://github.com/postcss/postcss-scss/blob/f540beae6530b7c9632f954e4d6915359a54f25f/lib/scss-tokenize.js
// TODO: Tokenize xcss tagged template literals within XCSS expressions
import type { Input } from 'postcss';
Function accessorsProxy
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function accessorsProxy<
T extends Record<string, unknown> | UndefinedProperty,
>(obj: T, parentPath: string): T {
for (const key in obj) {
if (has.call(obj, key)) {
- 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 xcss
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function xcss(
template: TemplateStringsArray,
...expressions: XCSSExpression[]
): string {
const strings = template.raw;
- 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 accessorsProxy
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function accessorsProxy<
T extends Record<string, unknown> | UndefinedProperty,
>(obj: T, parentPath: string): T {
for (const key in obj) {
if (has.call(obj, key)) {
Function xcss
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function xcss(
template: TemplateStringsArray,
...expressions: XCSSExpression[]
): string {
const strings = template.raw;
Consider simplifying this complex logical expression. Open
if (
escape &&
code !== SLASH &&
code !== SPACE &&
code !== NEWLINE &&
Avoid deeply nested control flow statements. Open
if (brackets === 0) break;
Function compile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function compile(
code: string,
{
from,
to,
- 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 resolveGlobals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function resolveGlobals(obj) {
/** @type {ResolvedExpressionOrNested} */
const resolved = {};
// eslint-disable-next-line no-restricted-syntax
- 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"