Showing 15 of 85 total issues
Function createActiveContainer
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
export function createActiveContainer<
Name extends ComponentName,
Props extends ActiveContainerBaseProps,
>(displayName: Name, defaultProps: ActiveContainerDefaults = {}): React.FC<Props> {
function ActiveContainer(props: Props) {
- 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 componentryPlugin
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export default function componentryPlugin(): ComponentryPlugin {
// Set up user defined default props and theme values for pre-compilation
__initializePreCompileMode(config)
const pluginObj: ComponentryPlugin = {
- 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 prepareAttributes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function prepareAttributes(
preCompiledAttributes: React.ReactElement<PreCompiledProps>['props'],
passThroughAttributes: t.JSXAttribute[],
): t.JSXAttribute[] {
const {
- 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 createActiveContainer
has 113 lines of code (exceeds 75 allowed). Consider refactoring. Open
export function createActiveContainer<
Name extends ComponentName,
Props extends ActiveContainerBaseProps,
>(displayName: Name, defaultProps: ActiveContainerDefaults = {}): React.FC<Props> {
function ActiveContainer(props: Props) {
Function ActiveContainer
has 109 lines of code (exceeds 75 allowed). Consider refactoring. Open
function ActiveContainer(props: Props) {
const {
// --- Render elements
children,
Function computeARIA
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function computeARIA({
active,
activeId,
guid,
type,
- 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 elementTests
has 97 lines of code (exceeds 75 allowed). Consider refactoring. Open
export function elementTests(TestComponent, testProps) {
const componentName = TestComponent.displayName
/*
* All components should have a display name so they can be easily debugged
Function createActiveAction
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function createActiveAction<
Name extends ComponentName,
Props extends ActiveActionBaseProps,
>(
displayName: Name,
- 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 componentryPlugin
has 83 lines of code (exceeds 75 allowed). Consider refactoring. Open
export default function componentryPlugin(): ComponentryPlugin {
// Set up user defined default props and theme values for pre-compilation
__initializePreCompileMode(config)
const pluginObj: ComponentryPlugin = {
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return
Function plugin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const plugin: PluginCreator<Record<string, never>> = () => {
return {
postcssPlugin: 'componentry',
AtRule: {
// Transforms at-rules like `@componentry button;` into component styles
- 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 Button
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Button = forwardRef<HTMLElement, ButtonProps>((props, ref) => {
const {
variant = 'filled',
children,
disabled,
- 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 closest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function closest(target: EventTarget | null, guid: string): EventTarget | null {
if (!target || !(target instanceof HTMLElement)) return null
if (target.dataset.id === guid) return target
if (target.parentNode && target.parentNode instanceof HTMLElement) {
- 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 Alert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Alert: Alert = (props) => {
const {
children,
active: _active,
ariaTitle,
- 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"