Showing 21 of 62 total issues
Function emitCss
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
export function emitCss({
combine = true,
debug = false,
emitEmpty = true,
exclude = [],
- 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 run
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function run(
env: NodeJS.ProcessEnv,
): Promise<BuildComponentResult> {
const pkgBrowser = env.npm_package_browser;
const pkgHomepage = env.npm_package_homepage;
Function emitHtml
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export function emitHtml({
basePath = '',
content = '%CSS%\n%JS%',
exclude,
include = [/\.(p|post)?css$/],
- 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 run
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function run(
env: NodeJS.ProcessEnv,
argv: string[] = [],
): Promise<ProcessCssResult[]> {
const args = mri(argv.slice(ARGS_START), {
Function run
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function run(
env: NodeJS.ProcessEnv,
argv: string[] = [],
): Promise<BuildLibResult | void> {
const args = mri(argv.slice(ARGS_START), {
Function generateBundle
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
async generateBundle(outputOpts, bundle) {
const minifyCss = (css: string): string => {
const cleancss = new CleanCSS({
sourceMap: false, // TODO: Add source map support
...(typeof optimize === 'object' ? optimize : {}),
Function postcssRollup
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function postcssRollup({
exclude = [/node_modules\/@minna-ui/],
include = [/\.(p|post)?css$/],
...options
}: RollupPostcssOptions = {}): rollup.Plugin {
- 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 style
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const style = (
opts: StylePreprocessorOptions = {},
// @ts-ignore - FIXME: Contribute types fix upstream
): Preprocessor => async ({ attributes, content, filename }) => {
if (attributes.type !== 'text/postcss') return;
- 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 run
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export async function run(
env: NodeJS.ProcessEnv,
argv: string[] = [],
): Promise<ProcessCssResult[]> {
const args = mri(argv.slice(ARGS_START), {
- 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 generateBundle
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateBundle(outputOpts) {
if (!styles.size) return;
const processCss = (css: string, id: string): void => {
if ((!css || !/\S/.test(css)) && !emitEmpty) {
Function transform
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async transform(code, id) {
if (!filter(id)) return;
try {
const context = merge(
Function run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export async function run(
env: NodeJS.ProcessEnv,
argv: string[] = [],
): Promise<BuildLibResult | void> {
const args = mri(argv.slice(ARGS_START), {
- 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 tooltip
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const tooltip: SvelteAction = (node, text) => {
const el = document.createElement('div');
el.className = 'tooltip';
el.textContent = text;
Function minify
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function minify(source: string, unsafe = false): string {
let code = `${source}`;
let count = 0;
const tags = [
Function transform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
transform(code, id) {
if (!filter(id)) return;
try {
const defaults = {
Function purgecss
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function purgecss({
content = [
// TODO: Document that using `__sapper__/*` requires 2 builds
'__sapper__/build/*.html',
'__sapper__/build/**/*.js',
- 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 resolveEntryFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function resolveEntryFile(cwd: string): string {
let result = '';
let index = 0;
while (!result && index < files.length) {
- 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 null;
Function warn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function warn(
from: string,
level: 'ERR' | 'WARN',
warnings: string[] | postcss.Warning[],
): void {
- 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 build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function build({
external,
input,
name,
pkgMain,
- 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"