rofrischmann/fela

View on GitHub

Showing 105 of 412 total issues

Function getFontFormat has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export default function getFontFormat(src) {
  if (isBase64(src)) {
    let mime = ''
    for (let i = 5; ; i++) {
      // 'data:'.length === 5
Severity: Minor
Found in packages/fela/src/getFontFormat.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 renderToMarkup has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function renderToMarkup(renderer) {
  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

    Function embeddedPlugin has a Cognitive Complexity of 20 (exceeds 5 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 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 _renderStyleToCache has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      renderer._renderStyleToCache = (
        className,
        style,
        pseudo = '',
        media = '',
    Severity: Major
    Found in packages/fela-monolithic/src/index.js - About 2 hrs to fix

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

        render() {
          const { tweet } = this.props;
          const { id, lang, media, textParts, timestamp, user } = tweet;
          const { fullName, profileImageUrl, screenName } = user;
      
      
      Severity: Major
      Found in benchmarks/src/implementations/react-native-web/Tweet/index.js - About 2 hrs to fix

        Function renderToSheetList has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function createSnapshotFactory has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function createSnapshotFactory(
            createElement,
            renderHandler,
            defaultRenderer,
            defaultRendererProvider,
          Severity: Major
          Found in packages/jest-fela-bindings/src/createAsyncSnapshotFactory.js - About 2 hrs to fix

            Function identifier has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function identifier(config = {}) {
              const { prefix = 'fela-identifier' } = config
              const { generator = defaultGenerator } = config
            
              const idRepository = {}
            Severity: Major
            Found in packages/fela-identifier/src/index.js - About 2 hrs to fix

              Function RULE_TYPE has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                [RULE_TYPE]: (cluster, { selector, declaration, support, media }) => {
                  const cssRule = generateCSSRule(selector, declaration)
              
                  if (support) {
                    if (media) {
              Severity: Minor
              Found in packages/fela-utils/src/clusterCache.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 render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const { components, x, y, depth, renderCount } = this.props;
                  let { s } = this.props;
                  const { Dot } = components;
              
              
              Severity: Major
              Found in benchmarks/src/cases/SierpinskiTriangle.js - About 2 hrs to fix

                Function rehydrate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function rehydrate(renderer, targetDocument = document) {
                  render(renderer, targetDocument)
                
                  arrayEach(targetDocument.querySelectorAll('[data-fela-type]'), (node) => {
                    const rehydrationAttribute =
                Severity: Major
                Found in packages/fela-dom/src/dom/rehydrate.js - About 2 hrs to fix

                  Function validateStyleObject has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function validateStyleObject(
                    style,
                    logInvalid,
                    deleteInvalid,
                    useCSSLint,
                  Severity: Major
                  Found in packages/fela-plugin-validator/src/index.js - About 2 hrs to fix

                    Function createSnapshot has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      return async function createSnapshot(
                        component,
                        theme = {},
                        renderer = defaultRenderer,
                        RendererProvider = defaultRendererProvider,
                    Severity: Minor
                    Found in packages/jest-fela-bindings/src/createAsyncSnapshotFactory.js - About 2 hrs to fix

                      Function Logo has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function Logo() {
                        return (
                          <Box
                            aria-hidden="true"
                            focusable="false"
                      Severity: Minor
                      Found in website/components/Logo.js - About 2 hrs to fix

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

                        export default function insertRule(
                          { selector, declaration, support, media, pseudo },
                          renderer,
                          node
                        ) {
                        Severity: Minor
                        Found in packages/fela-dom/src/dom/connection/insertRule.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 createRenderer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function createRenderer(config = {}) {
                          let renderer = {
                            listeners: [],
                            cache: {},
                            plugins: config.plugins || [],
                        Severity: Minor
                        Found in packages/fela-native/src/index.js - About 1 hr to fix

                          Function ruleSet has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                (ruleset, value, property) => {
                                  if (isPlainObject(value)) {
                                    if (isNestedSelector(property)) {
                                      renderer._renderStyleToCache(
                                        className,
                          Severity: Minor
                          Found in packages/fela-monolithic/src/index.js - About 1 hr to fix

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

                            function validateKeyframeObject(
                              style,
                              logInvalid,
                              deleteInvalid,
                              useCSSLint,
                            Severity: Minor
                            Found in packages/fela-plugin-validator/src/index.js - About 1 hr to fix

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

                              export default function getFontFormat(src) {
                                if (isBase64(src)) {
                                  let mime = ''
                                  for (let i = 5; ; i++) {
                                    // 'data:'.length === 5
                              Severity: Minor
                              Found in packages/fela/src/getFontFormat.js - About 1 hr to fix

                                Function RendererProviderFactory has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function RendererProviderFactory(
                                  BaseComponent,
                                  RendererContext,
                                  createElement,
                                  renderChildren,
                                Severity: Minor
                                Found in packages/fela-bindings/src/RendererProviderFactory.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language