Showing 113 of 376 total issues
Function PlacementExample
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PlacementExample() {
const [position, setPosition] = useState('top-start');
return (
<>
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (config) => {
const { env } = process;
config.set({
frameworks: ['mocha', 'webpack', 'sinon-chai'],
Function ThemedLiveEditor
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function ThemedLiveEditor() {
const { code } = useContext(LiveContext);
const isBrowser = useIsBrowser();
const [focused, setFocused] = useState(false);
const [ignoreTab, setIgnoreTab] = useState(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 OffcanvasExample
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function OffcanvasExample() {
return (
<>
{[false, 'sm', 'md', 'lg', 'xl', 'xxl'].map((expand) => (
<Navbar key={expand} expand={expand} className="bg-body-tertiary mb-3">
Function ToggleButtonGroup
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
> = React.forwardRef<HTMLElement, ToggleButtonGroupProps<any>>((props, ref) => {
const {
children,
type = 'radio',
name,
Function Alert
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
(uncontrolledProps: AlertProps, ref) => {
const {
bsPrefix,
show = true,
closeLabel = 'Close alert',
Function PopoverPositionedScrollingExample
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PopoverPositionedScrollingExample() {
const popover = (position) => (
<Popover id={`popover-positioned-scrolling-${position}`}>
<Popover.Header as="h3">{`Popover ${position}`}</Popover.Header>
<Popover.Body>
Function GridComplexExample
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GridComplexExample() {
return (
<Form>
<Row className="mb-3">
<Form.Group as={Col} controlId="formGridEmail">
Function BrandExample
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BrandExample() {
return (
<>
<Navbar className="bg-body-tertiary">
<Container>
Function AutoCloseExample
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AutoCloseExample() {
return (
<>
<Dropdown className="d-inline mx-2">
<Dropdown.Toggle id="dropdown-autoclose-true">
Function GroupExample
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GroupExample() {
return (
<CardGroup>
<Card>
<Card.Img variant="top" src="holder.js/100px160" />
Function DropdownMenu
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
(
{
bsPrefix,
className,
align,
- 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 useOverlayOffset
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function useOverlayOffset(
customOffset?: Offset,
): [React.RefObject<HTMLElement>, Options['modifiers']] {
const overlayRef = useRef<HTMLDivElement | null>(null);
const popoverClass = useBootstrapPrefix(undefined, 'popover');
- 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 DropDirectioExample
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DropDirectioExample() {
return (
<>
<div className="mb-2">
{['up', 'up-centered', 'down', 'down-centered', 'start', 'end'].map(
Function Tabs
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Tabs = (props: TabsProps) => {
const {
id,
onSelect,
transition,
Function visitCallExpression
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
visitCallExpression(path) {
if (types.ExpressionStatement.check(path.node)) {
path = path.get('expression');
}
if (path.node.type !== 'CallExpression') return false;
Function DismissibleExample
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DismissibleExample() {
const [showA, setShowA] = useState(true);
const [showB, setShowB] = useState(true);
const toggleShowA = () => setShowA(!showA);
Function Example
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Example() {
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
Function Nav
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
>((uncontrolledProps, ref) => {
const {
as = 'div',
bsPrefix: initialBsPrefix,
variant,
Function ToolbarExample
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ToolbarExample() {
return (
<>
<ButtonToolbar className="mb-3" aria-label="Toolbar with Button groups">
<ButtonGroup className="me-2" aria-label="First group">