Showing 113 of 376 total issues
Function Carousel
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
({ defaultActiveIndex = 0, ...uncontrolledProps }, ref) => {
const {
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
as: Component = 'div',
bsPrefix,
- 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
File Carousel.tsx
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
import useEventCallback from '@restart/hooks/useEventCallback';
import useUpdateEffect from '@restart/hooks/useUpdateEffect';
import useCommittedRef from '@restart/hooks/useCommittedRef';
import useTimeout from '@restart/hooks/useTimeout';
import Anchor from '@restart/ui/Anchor';
Function ResponsiveBreakpointsExample
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ResponsiveBreakpointsExample() {
return (
<div>
<Table responsive="sm">
<thead>
Function FormExample
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FormExample() {
const { Formik } = formik;
const schema = yup.object().shape({
firstName: yup.string().required(),
Function Modal
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
(
{
bsPrefix,
className,
style,
- 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 FormExample
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FormExample() {
const { Formik } = formik;
const schema = yup.object().shape({
firstName: yup.string().required(),
File Modal.tsx
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import classNames from 'classnames';
import addEventListener from 'dom-helpers/addEventListener';
import canUseDOM from 'dom-helpers/canUseDOM';
import ownerDocument from 'dom-helpers/ownerDocument';
import removeEventListener from 'dom-helpers/removeEventListener';
Function BorderExample
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BorderExample() {
return (
<>
<Card border="primary" style={{ width: '18rem' }}>
<Card.Header>Header</Card.Header>
Function Dropdown
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
React.forwardRef<HTMLElement, DropdownProps>((pProps, ref) => {
const {
bsPrefix,
drop = 'down',
show,
Function FormExample
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FormExample() {
const [validated, setValidated] = useState(false);
const handleSubmit = (event) => {
const form = event.currentTarget;
Function ThemedLiveEditor
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ThemedLiveEditor() {
const { code } = useContext(LiveContext);
const isBrowser = useIsBrowser();
const [focused, setFocused] = useState(false);
const [ignoreTab, setIgnoreTab] = useState(false);
Function ToggleButtonExample
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ToggleButtonExample() {
const [checked, setChecked] = useState(false);
const [radioValue, setRadioValue] = useState('1');
const radios = [
Function getDropdownMenuPlacement
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function getDropdownMenuPlacement(
alignEnd: boolean,
dropDirection?: DropDirection,
isRTL?: boolean,
) {
- 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 exports
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (ast) => {
let components = resolver.findAllComponentDefinitions(ast);
const getComment = (path) => {
let searchPath = path;
- 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 exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (ast) => {
let components = resolver.findAllComponentDefinitions(ast);
const getComment = (path) => {
let searchPath = path;
Function Offcanvas
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
(
{
bsPrefix,
className,
children,
- 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 Navbar
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
React.forwardRef<HTMLElement, NavbarProps>((props, ref) => {
const {
bsPrefix: initialBsPrefix,
expand = true,
variant = 'light',
Function ButtonDropdownsExample
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ButtonDropdownsExample() {
return (
<>
<InputGroup className="mb-3">
<DropdownButton
Function HorizontalExample
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function HorizontalExample() {
return (
<Form>
<Form.Group as={Row} className="mb-3" controlId="formHorizontalEmail">
<Form.Label column sm={2}>
Function Dropdown
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
React.forwardRef<HTMLElement, DropdownProps>((pProps, ref) => {
const {
bsPrefix,
drop = 'down',
show,
- 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"