rofrischmann/fela

View on GitHub

Showing 105 of 412 total issues

Function friendlyPseudoClassPlugin has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function friendlyPseudoClassPlugin(style) {
  for (const property in style) {
    const value = style[property]

    if (isPlainObject(value)) {
Severity: Minor
Found in packages/fela-plugin-friendly-pseudo-class/src/index.js - 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 render has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      benchmarkName,
      libraryName,
      sampleCount,
Severity: Minor
Found in benchmarks/src/app/ReportCard.js - About 1 hr to fix

    Function resolveNamedKeys has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    function resolveNamedKeys(style, keys) {
      for (const property in style) {
        const value = style[property]
    
        if (isPlainObject(value)) {
    Severity: Minor
    Found in packages/fela-plugin-named-keys/src/index.js - 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 createSubscription has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function createSubscription(
      renderer,
      targetDocument = document
    ) {
      return (change) => {
    Severity: Minor
    Found in packages/fela-dom/src/dom/connection/createSubscription.js - About 1 hr to fix

      Function getHeadings has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getHeadings(content) {
        const headings = []
      
        const components = {
          h2: ({ children }) => (
      Severity: Minor
      Found in website/utils/getPageDetails.js - About 1 hr to fix

        Function FelaComponentFactory has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function FelaComponentFactory(
          createElement,
          RendererContext,
          FelaTheme
        ) {
        Severity: Minor
        Found in packages/fela-bindings/src/FelaComponentFactory.js - About 1 hr to fix

          Function createRenderer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const createRenderer = () => {
            const plugins = [
              unit('px'),
              placeholderPrefixer(),
              friendlyPsuedo(),
          Severity: Minor
          Found in examples/example-with-styleguidist/src/common/createFelaRenderer.js - About 1 hr to fix

            Function embeddedPlugin has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function embeddedPlugin(style, type, renderer, props) {
              for (const property in style) {
                const value = style[property]
            
                if (property === 'fontFace' && typeof value === 'object') {
            Severity: Minor
            Found in packages/fela-plugin-embedded/src/index.js - About 1 hr to fix

              Function transformer has 32 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: Minor
              Found in packages/fela-codemods/src/v10/RendererProvider.js - About 1 hr to fix

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

                  componentDidUpdate() {
                    const { forceLayout, sampleCount, timeout, type } = this.props;
                    const { cycle, running } = this.state;
                
                    if (running && shouldRecord(cycle, type)) {
                Severity: Minor
                Found in benchmarks/src/app/Benchmark/index.js - 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 Icon has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Icon = (props) => {
                  const { css } = useFela()
                
                  if (!props.icon) {
                    return null
                Severity: Minor
                Found in website/components/Icon.js - About 1 hr to fix

                  Function generateHeadings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function generateHeadings(file) {
                    const headings = []
                  
                    const components = {
                      h2: ({ children }) => (
                  Severity: Minor
                  Found in website/scripts/generate-headings.js - About 1 hr to fix

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

                    export default function Page() {
                      const { theme } = useFela()
                    
                      return (
                        <>
                    Severity: Minor
                    Found in website/pages/404.js - About 1 hr to fix

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

                      export default function createNode(
                        attributes,
                        targetDocument = document,
                        sortMediaQuery,
                        styleNodeAttributes
                      Severity: Minor
                      Found in packages/fela-dom/src/dom/connection/createNode.js - About 1 hr to fix

                        Function generateCacheEntry has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          type,
                          className,
                          property,
                          value,
                          pseudo = '',
                        Severity: Major
                        Found in packages/fela-dom/src/dom/rehydration/generateCacheEntry.js - About 1 hr to fix

                          Function createNode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export default function createNode(
                            attributes,
                            targetDocument = document,
                            sortMediaQuery,
                            styleNodeAttributes
                          Severity: Minor
                          Found in packages/fela-dom/src/dom/connection/createNode.js - 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 validateStyleObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function validateStyleObject(
                            style,
                            logInvalid,
                            deleteInvalid,
                            useCSSLint,
                          Severity: Minor
                          Found in packages/fela-plugin-validator/src/index.js - 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 addUnit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function addUnit(style, defaultUnit, propertyMap, isUnitlessProperty) {
                            for (const property in style) {
                              if (!isUnitlessProperty(property)) {
                                const cssValue = style[property]
                                const propertyUnit = propertyMap[property] || defaultUnit
                          Severity: Minor
                          Found in packages/fela-plugin-unit/src/index.js - 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 importantPlugin has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function importantPlugin(style) {
                            if (!isAnimation(style)) {
                              for (const property in style) {
                                const value = style[property]
                                if (property === 'className') {
                          Severity: Minor
                          Found in packages/fela-plugin-important/src/index.js - 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 resolveCustomProperty has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function resolveCustomProperty(style, properties) {
                            for (const property in style) {
                              const value = style[property]
                          
                              if (properties.hasOwnProperty(property)) {
                          Severity: Minor
                          Found in packages/fela-plugin-custom-property/src/index.js - 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

                          Severity
                          Category
                          Status
                          Source
                          Language