Showing 445 of 2,739 total issues
Function HelpText
has 104 lines of code (exceeds 25 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');
Function PrimitiveMenu
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrimitiveMenu = React.forwardRef((props, ref) => {
const {
id,
className,
style,
Function LocationIcon
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LocationIcon = props => {
const { className } = props;
return (
<svg
className={className}
Function ImportRecordsFlow
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
function ImportRecordsFlow(props) {
const {
className,
style,
isOpen,
- 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 Code
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Code = props => {
const { className, style } = props;
return (
<svg
className={className}
Function render
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
style,
className,
label,
Function StripeCardInput
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StripeCardInput = React.forwardRef((props, ref) => {
const {
id,
apiKey,
label,
Function render
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { hour, minutes, ampm, inputFocusedIndex } = this.state;
const { onCloseModal, cancelLabel, okLabel, hour24, className } = this.props;
const hourPlaceholder = this.prevHour || '--';
const minutesPlaceholder = this.prevMinutes || '--';
Function FilesIcon
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function FilesIcon() {
return (
<svg width="21px" height="20px" viewBox="0 0 21 20" version="1.1">
<g id="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g id="Components-FileSelector-" transform="translate(-432.000000, -1023.000000)">
Function DesignIcon
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DesignIcon = props => {
const { className } = props;
return (
<svg className={className} width="25px" height="26px" viewBox="0 0 25 26" version="1.1">
<g id="design">
Function AssignFieldModal
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function AssignFieldModal(props) {
const {
isAssignFieldModalOpen,
onRequestClose,
columns,
Function resolveCustomBackground
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
function resolveCustomBackground(background) {
if (background && isValidColor(background)) {
const dark = isDark(background);
const mainText = getContrastText(background);
const theme = {
- 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
TimeSelect
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class TimeSelect extends Component {
constructor(props) {
super(props);
this.state = {
hour: getHour(props.value),
Function CountriesDropdown
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
React.forwardRef((props, ref) => {
const {
country,
countries,
isOpen,
Function CodeInput
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CodeInput = React.forwardRef((props, ref) => {
const {
id,
value: valueProp,
label,
Function Saturation
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Saturation = React.forwardRef((_props, ref) => {
const { rgba, hsv, tabIndex, onChange } = useContext(ColorPickerContext);
const containerRef = useRef();
const isMouseDown = useRef(false);
const [h, s, v] = hsv;
Function DayComponent
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DayComponent(props) {
const {
date,
firstDayMonth,
isSelected,
Function Photographer
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Photographer = props => {
const { className, style } = props;
return (
<svg
className={className}
File index.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useRef, useState, useCallback, useEffect } from 'react';
import PropTypes from 'prop-types';
import { useUniqueIdentifier } from '../../../libs/hooks';
import { Provider } from '../context';
import RightIcon from '../icons/rightArrow';
Function WeeklyCalendar
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function WeeklyCalendar(props) {
const {
events,
currentWeek,
minDate,