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
- 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 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)
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') {
- 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 _renderStyleToCache
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderer._renderStyleToCache = (
className,
style,
pseudo = '',
media = '',
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;
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)
Function createSnapshotFactory
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createSnapshotFactory(
createElement,
renderHandler,
defaultRenderer,
defaultRendererProvider,
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 = {}
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) {
- 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 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;
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 =
Function validateStyleObject
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validateStyleObject(
style,
logInvalid,
deleteInvalid,
useCSSLint,
Function createSnapshot
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
return async function createSnapshot(
component,
theme = {},
renderer = defaultRenderer,
RendererProvider = defaultRendererProvider,
Function Logo
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Logo() {
return (
<Box
aria-hidden="true"
focusable="false"
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
) {
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createRenderer(config = {}) {
let renderer = {
listeners: [],
cache: {},
plugins: config.plugins || [],
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,
Function validateKeyframeObject
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validateKeyframeObject(
style,
logInvalid,
deleteInvalid,
useCSSLint,
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
Function RendererProviderFactory
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function RendererProviderFactory(
BaseComponent,
RendererContext,
createElement,
renderChildren,