Showing 105 of 412 total issues
Function createComponentFactory
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
export default function createComponentFactory(
createElement,
RendererContext,
FelaTheme,
withProxy = false,
- Read upRead up
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 294 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createRenderer(config = {}) {
let renderer = {
listeners: [],
keyframePrefixes: config.keyframePrefixes || ['-webkit-', '-moz-'],
plugins: config.plugins || [],
File DocLayout.js
has 540 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect, useLayoutEffect, useRef } from 'react'
import Head from 'next/head'
import NextLink from 'next/link'
import { useRouter } from 'next/router'
import { useFela } from 'react-fela'
Function Page
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Page() {
const { theme } = useFela()
return (
<main id="main" role="main" aria-label="Main content">
Function createRenderer
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
export default function createRenderer(config = {}) {
let renderer = {
listeners: [],
keyframePrefixes: config.keyframePrefixes || ['-webkit-', '-moz-'],
plugins: config.plugins || [],
- Read upRead up
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 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { tests } = this.props
const {
currentBenchmarkName,
status,
Function useMonolithicRenderer
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useMonolithicRenderer(renderer, prettySelectors = false) {
renderer.prettySelectors = prettySelectors
renderer._renderStyleToCache = (
className,
Function createComponentFactory
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createComponentFactory(
createElement,
RendererContext,
FelaTheme,
withProxy = false,
Function createComponent
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function createComponent(rule, type = 'div', passThroughProps = []) {
const displayName = rule.name ? rule.name : 'FelaComponent'
const FelaComponent = ({
children,
Function _renderStyleToClassNames
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderStyleToClassNames(style, pseudo = '', media = '', support = '') {
let classNames = ''
const applyPlugin = (processed, plugin) => plugin(processed, renderer)
File createRenderer.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { cssifyDeclaration } from 'css-in-js-utils'
import { arrayEach, arrayReduce, arrayFilter } from 'fast-loops'
import isPlainObject from 'isobject'
import {
Function connectFactory
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function connectFactory(
BaseComponent,
createElement,
RendererContext,
ThemeContext
Function connect
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function connect(rules, config = {}) {
const connectConfig = {
...defaultConfig,
...config,
}
Function transformer
has 89 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)
Function useMonolithicRenderer
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function useMonolithicRenderer(renderer, prettySelectors = false) {
renderer.prettySelectors = prettySelectors
renderer._renderStyleToCache = (
className,
- Read upRead up
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 addStatistics
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addStatistics(renderer) {
const statistics = {
count: {
classes: 0,
pseudoClasses: 0,
Function getNodeSibling
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export default function getNodeSibling(
nodes,
{ type, media, support },
sortMediaQuery
) {
- Read upRead up
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 renderFn
has 80 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?"
)
File App.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Benchmark from './Benchmark'
import {
Picker,
StyleSheet,
ScrollView,
Function render
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { extend, _felaRules, ...otherProps } = this.props
const allRules = [rules]
if (_felaRules) {