rofrischmann/fela

View on GitHub

Showing 412 of 412 total issues

Function generateDeclarationReference has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  property,
  value,
  pseudo = '',
  media = '',
  support = ''
Severity: Minor
Found in packages/fela-utils/src/generateDeclarationReference.js - About 35 mins to fix

    Function rehydrateRules has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      css,
      media = '',
      support = '',
      cache = {},
      specificityPrefix = ''
    Severity: Minor
    Found in packages/fela-dom/src/dom/rehydration/rehydrateRules.js - About 35 mins to fix

      Function validateStyleObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        style,
        logInvalid,
        deleteInvalid,
        useCSSLint,
        cssRules
      Severity: Minor
      Found in packages/fela-plugin-validator/src/index.js - About 35 mins to fix

        Function validateKeyframeObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          style,
          logInvalid,
          deleteInvalid,
          useCSSLint,
          cssRules
        Severity: Minor
        Found in packages/fela-plugin-validator/src/index.js - About 35 mins to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              expect(
                createSnapshot(
                  <Button style={{ backgroundColor: 'blue' }} color="black">
                    Hello World
                  </Button>
          packages/fela-integration/src/jest-react-fela_react-fela/__tests__/FelaComponent-test.js on lines 155..161

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 47.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              expect(
                createSnapshot(
                  <Button style={{ backgroundColor: 'blue' }} as="button">
                    Hello World
                  </Button>
          packages/fela-integration/src/jest-react-fela_react-fela/__tests__/FelaComponent-test.js on lines 180..186

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 47.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

            const setFontSize = width => {
              const fontSize = width > medium ? (width > large ? '18px' : '17px') : '16px';
              if (htmlElement) {
                htmlElement.style.fontSize = fontSize;
              }
          Severity: Minor
          Found in benchmarks/src/app/theme.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

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

            render() {
              const { components, x, y, depth, renderCount } = this.props;
              let { s } = this.props;
              const { Dot } = components;
          
          
          Severity: Minor
          Found in benchmarks/src/cases/SierpinskiTriangle.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

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

          export function Content({ docsPath, children }) {
            const router = useRouter()
            const { theme } = useFela()
          
            return (
          Severity: Minor
          Found in website/components/DocLayout.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

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

          export default function sortMediaQuery(mediaQueryOrder = []) {
            return function sort(a, b) {
              if (mediaQueryOrder.indexOf(b) === -1) {
                if (mediaQueryOrder.indexOf(a) === -1) {
                  return 0
          Severity: Minor
          Found in packages/fela/src/sortMediaQuery.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

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

          function nativeMediaQueryPlugin(style) {
            const { width, height } = Dimensions.get('window')
          
            for (const property in style) {
              const value = style[property]
          Severity: Minor
          Found in packages/fela-plugin-native-media-query/src/index.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

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

          export default function Heading({ level, children }) {
            const { theme } = useFela()
          
            const [text, fixedId] = getFixedId(children)
            const id = getId(children, level, fixedId)
          Severity: Minor
          Found in website/components/Heading.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

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

          function typescript(style) {
            for (const property in style) {
              const value = style[property]
          
              if (property === 'nested' && isPlainObject(value)) {
          Severity: Minor
          Found in packages/fela-plugin-typescript/src/index.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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                        <Text style={[styles.smallText, styles.monoFont]}>
                          (S/L) {fmt(meanScripting)}/{fmt(meanLayout)} ms
                        </Text>
          Severity: Minor
          Found in benchmarks/src/app/ReportCard.js and 1 other location - About 35 mins to fix
          benchmarks/src/app/ReportCard.js on lines 40..42

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                    } else if (isSupport(property)) {
                      const combinedSupport = generateCombinedMediaQuery(
                        support,
                        property.slice(9).trim()
                      )
          Severity: Minor
          Found in packages/fela-monolithic/src/index.js and 1 other location - About 35 mins to fix
          packages/fela-monolithic/src/index.js on lines 40..69

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                fontFace: [
                  {
                    fontFamily: 'Arial',
                    src: ['foo.svg', 'bar.ttf'],
                    fontWeight: 500,
          Severity: Minor
          Found in packages/fela-plugin-embedded/src/__tests__/embedded-test.js and 1 other location - About 35 mins to fix
          packages/fela-plugin-embedded/src/__tests__/embedded-test.js on lines 107..118

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                fontFace: [
                  {
                    fontFamily: 'Arial',
                    src: ['arial-regular.svg', 'arial-regular.ttf'],
                    fontWeight: 400,
          Severity: Minor
          Found in packages/fela-plugin-embedded/src/__tests__/embedded-test.js and 1 other location - About 35 mins to fix
          packages/fela-plugin-embedded/src/__tests__/embedded-test.js on lines 54..65

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                    } else if (isMediaQuery(property)) {
                      const combinedMediaQuery = generateCombinedMediaQuery(
                        media,
                        property.slice(6).trim()
                      )
          Severity: Minor
          Found in packages/fela-monolithic/src/index.js and 1 other location - About 35 mins to fix
          packages/fela-monolithic/src/index.js on lines 53..69

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                        <Text style={[styles.bold, styles.monoFont]}>
                          {fmt(mean)} ±{fmt(stdDev)} ms
                        </Text>
          Severity: Minor
          Found in benchmarks/src/app/ReportCard.js and 1 other location - About 35 mins to fix
          benchmarks/src/app/ReportCard.js on lines 43..45

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Avoid too many return statements within this function.
          Open

                return undefined
          Severity: Major
          Found in packages/fela-dom/src/dom/connection/getNodeSibling.js - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language