WeAreGenki/minna-ui

View on GitHub

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 = [],
Severity: Minor
Found in utils/rollup-plugin-emit-css/src/index.ts - About 6 hrs to fix

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;
Severity: Major
Found in utils/build-component/src/index.ts - About 4 hrs to fix

    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$/],
    Severity: Minor
    Found in utils/rollup-plugin-emit-html/src/index.ts - About 3 hrs to fix

    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), {
    Severity: Major
    Found in utils/build-css/src/index.ts - About 3 hrs to fix

      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), {
      Severity: Major
      Found in utils/build-lib/src/index.ts - About 2 hrs to fix

        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 : {}),
        Severity: Major
        Found in utils/rollup-plugin-emit-html/src/index.ts - About 2 hrs to fix

          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 {
          Severity: Minor
          Found in utils/rollup-plugin-postcss/src/plugin.ts - About 2 hrs to fix

          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), {
          Severity: Minor
          Found in utils/build-css/src/index.ts - About 1 hr to fix

          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;
          Severity: Minor
          Found in utils/preprocess/src/style.ts - About 1 hr to fix

          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) {
          Severity: Minor
          Found in utils/rollup-plugin-emit-css/src/index.ts - About 1 hr to fix

            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(
            Severity: Minor
            Found in utils/rollup-plugin-postcss/src/plugin.ts - About 1 hr to fix

              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), {
              Severity: Minor
              Found in utils/build-lib/src/index.ts - About 1 hr to fix

              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;
              
              
              Severity: Minor
              Found in components/tooltip/src/index.ts - About 1 hr to fix

                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 = [
                Severity: Minor
                Found in utils/preprocess/src/markup.ts - About 1 hr to fix

                  Function transform has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      transform(code, id) {
                        if (!filter(id)) return;
                  
                        try {
                          const defaults = {
                  Severity: Minor
                  Found in utils/rollup-plugin-purgecss/src/index.ts - About 1 hr to fix

                    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',
                    Severity: Minor
                    Found in utils/rollup-plugin-purgecss/src/index.ts - About 35 mins to fix

                    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) {
                    Severity: Minor
                    Found in utils/build-lib/src/utils.ts - About 35 mins to fix

                    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;
                    Severity: Major
                    Found in utils/jest-config/transforms/es.js - About 30 mins to fix

                      Function run has a Cognitive Complexity of 6 (exceeds 5 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;
                      Severity: Minor
                      Found in utils/build-component/src/index.ts - About 25 mins to fix

                      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,
                      Severity: Minor
                      Found in utils/build-lib/src/build.ts - About 25 mins to fix

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language