rofrischmann/fela

View on GitHub

Showing 92 of 306 total issues

Function createComponentFactory has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
Open

export default function createComponentFactory(
  createElement: Function,
  RendererContext: any,
  FelaTheme: Function,
  withProxy: boolean = false,
Severity: Minor
Found in packages/fela-bindings/src/createComponentFactory.js - About 1 day 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 createRenderer has 240 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function createRenderer(
  config: DOMRendererConfig = {}
): DOMRenderer {
  let renderer: DOMRenderer = {
    listeners: [],
Severity: Major
Found in packages/fela/src/createRenderer.js - About 1 day to fix

    Function runBrowserTest has 147 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const runBrowserTest = (testName, caseName) => () => {
      var url = `http://localhost:8123/${testName}/${caseName}.html`
      const traceCategories = [
        'blink.console',
        'devtools.timeline',
    Severity: Major
    Found in benchmarks/ssr-comparison/src/run.js - About 5 hrs to fix

      Function render has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { tests } = this.props
          const {
            currentBenchmarkName,
            status,
      Severity: Major
      Found in benchmarks/dom-comparison/src/app/App.js - About 5 hrs to fix

        Function createRenderer has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function createRenderer(
          config: DOMRendererConfig = {}
        ): DOMRenderer {
          let renderer: DOMRenderer = {
            listeners: [],
        Severity: Minor
        Found in packages/fela/src/createRenderer.js - 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 useMonolithicRenderer has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function useMonolithicRenderer(
          renderer: DOMRenderer,
          prettySelectors: boolean = false
        ): MonolithicRenderer {
          renderer.prettySelectors = prettySelectors
        Severity: Major
        Found in packages/fela-monolithic/src/index.js - About 4 hrs to fix

          Function createComponentFactory has 106 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function createComponentFactory(
            createElement: Function,
            RendererContext: any,
            FelaTheme: Function,
            withProxy: boolean = false,
          Severity: Major
          Found in packages/fela-bindings/src/createComponentFactory.js - About 4 hrs to fix

            Function createComponent has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              return function createComponent(
                rule: Function,
                type: any = 'div',
                passThroughProps: Array<string> | Function = []
              ): Function {
            Severity: Major
            Found in packages/fela-bindings/src/createComponentFactory.js - About 4 hrs to fix

              Function connectFactory has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function connectFactory(
                BaseComponent: any,
                createElement: Function,
                RendererContext: any,
                ThemeContext: any
              Severity: Major
              Found in packages/fela-bindings/src/connectFactory.js - About 3 hrs to fix

                Function transformer has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function transformer(file, api) {
                  const j = api.jscodeshift
                
                  const importName = getImportName(j, file.source, pkg, component)
                
                
                Severity: Major
                Found in packages/fela-codemods/src/v10/FelaComponent.js - About 3 hrs to fix

                  Function connect has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    return function connect(
                      rules: Object | Function,
                      config: ConnectConfig = {}
                    ): Function {
                      const connectConfig = {
                  Severity: Major
                  Found in packages/fela-bindings/src/connectFactory.js - About 3 hrs to fix

                    Function addStatistics has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addStatistics(
                      renderer: DOMRenderer
                    ): DOMRenderer & RendererWithStatistics {
                      const statistics = {
                        count: {
                    Severity: Major
                    Found in packages/fela-statistics/src/index.js - About 3 hrs to fix

                      Function _renderStyleToClassNames has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _renderStyleToClassNames(
                            { _className, ...style }: Object,
                            pseudo: string = '',
                            media: string = '',
                            support: string = ''
                      Severity: Major
                      Found in packages/fela/src/createRenderer.js - About 3 hrs to fix

                        Function getNodeSibling has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function getNodeSibling(
                          nodes: Object,
                          { type, media, support }: NodeAttributes,
                          sortMediaQuery: Function
                        ) {
                        Severity: Minor
                        Found in packages/fela-dom/src/dom/connection/getNodeSibling.js - 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

                        File App.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable react/prop-types */
                        
                        import Benchmark from './Benchmark'
                        import {
                          Picker,
                        Severity: Minor
                        Found in benchmarks/dom-comparison/src/app/App.js - About 3 hrs to fix

                          Function renderFn has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  createElement(FelaTheme, undefined, _felaTheme => {
                                    if (!renderer) {
                                      throw new Error(
                                        "createComponent() can't render styles without the renderer in the context. Missing react-fela's <Provider /> at the app root?"
                                      )
                          Severity: Major
                          Found in packages/fela-bindings/src/createComponentFactory.js - About 3 hrs to fix

                            Function useMonolithicRenderer has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function useMonolithicRenderer(
                              renderer: DOMRenderer,
                              prettySelectors: boolean = false
                            ): MonolithicRenderer {
                              renderer.prettySelectors = prettySelectors
                            Severity: Minor
                            Found in packages/fela-monolithic/src/index.js - 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

                            File createRenderer.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* @flow */
                            import cssifyDeclaration from 'css-in-js-utils/lib/cssifyDeclaration'
                            import arrayEach from 'fast-loops/lib/arrayEach'
                            import isPlainObject from 'isobject'
                            
                            
                            Severity: Minor
                            Found in packages/fela/src/createRenderer.js - About 3 hrs to fix

                              Function render has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      render() {
                                        const { extend, _felaRules, ...otherProps } = this.props
                              
                                        const allRules = [rules]
                                        if (_felaRules) {
                              Severity: Major
                              Found in packages/fela-bindings/src/connectFactory.js - About 2 hrs to fix

                                Function renderToMarkup has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function renderToMarkup(renderer: DOMRenderer): string {
                                  const cacheCluster = clusterCache(renderer.cache, renderer.ruleOrder)
                                
                                  const rehydrationIndex = getRehydrationIndex(renderer)
                                
                                
                                Severity: Major
                                Found in packages/fela-dom/src/server/renderToMarkup.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language