winston0410/camouflage

View on GitHub

Showing 15 of 26 total issues

Function addOn has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

const addOn = function(renderer: Renderer): void {
    // Setting the cache outside this function may result in more persistant but unexpected behaviors
    createCache(renderer, 'cache')

    const objectToClassNames = (
Severity: Minor
Found in src/addon/virtual.ts - About 5 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 addOn has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

const addOn = function(renderer: Renderer): void {
  createCache(renderer, 'cache')
  createCache(renderer, 'kcache')

  renderer.hydrate = function(sh) {
Severity: Minor
Found in src/addon/hydration.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 addOn has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const addOn = function (renderer) {
    // Setting the cache outside this function may result in more persistant but unexpected behaviors
    renderer.cache = {}
    // This can should be used for validating against 1) Rules generated with virtua()/atomic() 2) Rules received from hydration()

Severity: Minor
Found in benchmarks/cacheStyle/rendererCache.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 addOn has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const addOn = function (renderer) {
    // Setting the cache outside this function may result in more persistant but unexpected behaviors
    const cache = {}
    // This can should be used for validating against 1) Rules generated with virtua()/atomic() 2) Rules received from hydration()

Severity: Minor
Found in benchmarks/cacheStyle/variableCache.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 addOn has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const addOn = function(renderer: Renderer): void {
    // Setting the cache outside this function may result in more persistant but unexpected behaviors
    createCache(renderer, 'cache')

    const objectToClassNames = (
Severity: Major
Found in src/addon/virtual.ts - About 2 hrs to fix

    Function create has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    const create = function (config: Renderer): Renderer {
        const renderer = {
            raw: '',
            pfx: '',
            client: isBrowser,
    Severity: Minor
    Found in 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 addOn has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const addOn = function (renderer) {
        // Setting the cache outside this function may result in more persistant but unexpected behaviors
        renderer.cache = {}
        // This can should be used for validating against 1) Rules generated with virtua()/atomic() 2) Rules received from hydration()
    
    
    Severity: Minor
    Found in benchmarks/cacheStyle/rendererCache.ts - About 1 hr to fix

      Function addOn has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const addOn = function (renderer) {
          // Setting the cache outside this function may result in more persistant but unexpected behaviors
          const cache = {}
          // This can should be used for validating against 1) Rules generated with virtua()/atomic() 2) Rules received from hydration()
      
      
      Severity: Minor
      Found in benchmarks/cacheStyle/variableCache.ts - About 1 hr to fix

        Function create has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const create = function (config: Renderer): Renderer {
            const renderer = {
                raw: '',
                pfx: '',
                client: isBrowser,
        Severity: Minor
        Found in src/index.ts - About 1 hr to fix

          Function addOn has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const addOn = function(renderer: Renderer): void {
            createCache(renderer, 'cache')
            createCache(renderer, 'kcache')
          
            renderer.hydrate = function(sh) {
          Severity: Minor
          Found in src/addon/hydration.ts - About 1 hr to fix

            Function createComponent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            const createComponent = (
                Tag: Tag,
                callback: (props: object) => object,
                name,
                renderer: Renderer
            Severity: Minor
            Found in src/addon/jsx.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 objectToClassNames has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                const objectToClassNames = (
                    decls: object,
                    selector = '',
                    atRule = ''
                ): ClassName => {
            Severity: Minor
            Found in src/addon/virtual.ts - About 1 hr to fix

              Function objectToClassNames has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  const objectToClassNames = (decls, selector = '', atRule = '') => {
                      let classNames = ''
                      for (const prop in decls) {
                          const value = decls[prop]
                          const id = `${atRule}${selector}${prop}${value}`
              Severity: Minor
              Found in benchmarks/cacheStyle/variableCache.ts - About 1 hr to fix

                Function objectToClassNames has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const objectToClassNames = (decls, selector = '', atRule = '') => {
                        let classNames = ''
                        for (const prop in decls) {
                            const value = decls[prop]
                            const id = `${atRule}${selector}${prop}${value}`
                Severity: Minor
                Found in benchmarks/cacheStyle/rendererCache.ts - About 1 hr to fix

                  Function addOn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const addOn = function(renderer: Renderer, config = defaultConfig): void {
                    createCache(renderer, 'kcache')
                  
                    const { prefixes } = config
                  
                  
                  Severity: Minor
                  Found in src/addon/keyframes.ts - About 55 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