rofrischmann/fela

View on GitHub

Showing 105 of 412 total issues

Function createSnapshotFactory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function createSnapshotFactory(
  createElement,
  renderHandler,
  defaultRenderer,
  defaultRendererProvider,
Severity: Minor
Found in packages/jest-fela-bindings/src/createAsyncSnapshotFactory.js - About 25 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 extractUsedProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function extractUsedProps(rule, theme = {}) {
  const usedProps = []

  // if the browser doesn't support proxies
  // we simply return an empty props object
Severity: Minor
Found in packages/fela-bindings/src/extractUsedProps.js - About 25 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 generateFontSource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function generateFontSource(files = [], fontLocals = []) {
  const localSource = arrayReduce(
    fontLocals,
    (src, local, index) => {
      const prefix = index > 0 ? ',' : ''
Severity: Minor
Found in packages/fela/src/generateFontSource.js - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { tests } = this.props
    const {
      currentBenchmarkName,
      status,
Severity: Minor
Found in benchmarks/src/app/App.js - About 25 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 resolveThemeValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function resolveThemeValues(style, theme = {}, mapping) {
  for (const property in style) {
    const value = style[property]

    if (typeof value === 'string' && mapping[property]) {
Severity: Minor
Found in packages/fela-plugin-theme-value/src/index.js - About 25 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