Showing 445 of 2,739 total issues
Function InputItem
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InputItem = React.forwardRef((props, ref) => {
const {
value,
index,
disabled,
Function constructor
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(props) {
super(props);
const normalizedOptions = getNormalizedOptions(props.options || []);
this.state = {
searchValue: '',
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
items,
value,
onSelectOption,
Function StackoverflowIcon
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function StackoverflowIcon(props) {
const { className, style } = props;
return (
<svg className={className} style={style} width="89px" height="115px" viewBox="0 0 89 115">
Function HelpText
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
const HelpText = React.forwardRef((props, ref) => {
const { id, title, text, variant, tabIndex, iconSize, className, style } = props;
const triggerRef = useRef();
const helpTextId = useUniqueIdentifier('help-text');
- 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 getUpdatedRowsWhenDeselect
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function getUpdatedRowsWhenDeselect(params = {}) {
const {
maxRowSelection,
rows = [],
indexes = {},
Function SelectableCell
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function SelectableCell(props) {
const { isSelected, isDisabled, tableId, onSelectRow, onDeselectRow, inputType } = props;
const name = `${tableId}-options`;
const isRadio = inputType === 'radio';
Function InternalTooltip
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InternalTooltip = React.forwardRef((props, ref) => {
const [pos, setPos] = useState();
const { className, style, children, isVisible, preferredPosition, triggerElementRef } = props;
const tooltipRef = useRef();
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
title,
tabIndex,
onClick,
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
id,
className,
style,
Function InputItems
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InputItems = React.forwardRef((props, ref) => {
const {
value,
disabled,
required,
Function Hours
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Hours = React.forwardRef((props, ref) => {
const { today, setToday, locale } = props;
const clock = useTimer();
useEffect(() => {
if (!isSameDay(today, clock)) {
Function CellValue
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function CellValue(props) {
const {
component: CellComponent,
value,
rowData,
Function WeekDayItems
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const WeekDayItems = React.forwardRef((props, ref) => {
const {
name,
value,
availableDates,
Function ButtonOption
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ButtonOption(props) {
const inputId = useUniqueIdentifier('button-option');
const { className, style, name, label, disabled, onClick } = props;
const {
Function Spinner
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Spinner(props) {
const { className, style, assistiveText, isVisible, size, variant, type, children } = props;
const currentSize = getSizeValue(size);
if (isVisible) {
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
style,
label,
labelAlignment,
Function ClockIcon
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ClockIcon(props) {
const { className, style } = props;
return (
<svg className={className} style={style} width="24px" height="24px" viewBox="0 0 24 24">
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
label,
style,
className,
Function WeekDay
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const WeekDay = React.forwardRef((props, ref) => {
const {
name,
value,
locale,