MaxMilton/ekscss

View on GitHub

Showing 9 of 20 total issues

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) {
Severity: Major
Found in packages/cli/index.js - About 3 hrs to fix

    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 "@typescript-eslint/no-unsafe-argument": "warn" */
    /* eslint "@typescript-eslint/no-unsafe-call": "warn" */
    /* eslint "@typescript-eslint/no-unsafe-member-access": "warn" */
    Severity: Minor
    Found in packages/framework/config.js - About 3 hrs to fix

      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) {
      Severity: Minor
      Found in packages/cli/index.js - 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 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)) {
      Severity: Minor
      Found in packages/ekscss/src/helpers.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 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;
      Severity: Minor
      Found in packages/ekscss/src/helpers.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 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)) {
      Severity: Minor
      Found in packages/ekscss/src/helpers.ts - About 1 hr to fix

        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;
        Severity: Minor
        Found in packages/ekscss/src/helpers.ts - About 1 hr to fix

          Function compile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          export function compile(
            code: string,
            {
              from,
              to,
          Severity: Minor
          Found in packages/ekscss/src/compiler.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 resolveGlobals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function resolveGlobals(obj) {
            /** @type {ResolvedExpressionOrNested} */
            const resolved = {};
          
            for (const [key, value] of Object.entries(obj)) {
          Severity: Minor
          Found in packages/framework/utils.js - 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

          Severity
          Category
          Status
          Source
          Language