nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

Function Indicator has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Indicator = props => {
    const { id, containerId, header, onSelect, selectedItem, onCreate, onDestroy } = props;
    const indicatorRef = useRef();

    useEffect(() => {
Severity: Minor
Found in src/components/CarouselCard/indicators/indicator.js - About 1 hr to fix

    Function CSVCell has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function CSVCell(props) {
        const { onClick, row, value, borderRadius } = props;
        return (
            <CellContainer>
                <RenderIf isTrue={value}>
    Severity: Minor
    Found in src/components/ImportRecordsFlow/stepThree/csvCell.js - About 1 hr to fix

      Function Dataset has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function Dataset(props) {
          const datasetId = useUniqueIdentifier('dataset');
          const { title: label, values: data, ...rest } = props;
          const { registerDataset, unregisterDataset, updateDataset } = React.useContext(ChartContext);
          const isRegistered = useRef();
      Severity: Minor
      Found in src/components/Dataset/index.js - About 1 hr to fix

        Function scrollToSelectedTab has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            scrollToSelectedTab(name) {
                const { tabsetChildren } = this;
                const tabset = this.tabsetRef.current;
                const { scrollLeft, offsetWidth: tabsetWidth } = tabset;
                const tabIndex = getTabIndexFromName(tabsetChildren, name);
        Severity: Minor
        Found in src/components/Tabset/index.js - About 1 hr to fix

          Function Saturation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          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;
          Severity: Minor
          Found in src/components/ColorPicker/commons/saturation/index.js - About 1 hr to fix

          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 DatePicker has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          const DatePicker = React.forwardRef((props, ref) => {
              const {
                  value,
                  minDate,
                  maxDate,
          Severity: Minor
          Found in src/components/DatePicker/index.js - About 1 hr to fix

          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 rgbToHsv has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function rgbToHsv(color) {
              const { type, values } = decomposeColor(color);
              if (!type || !values || type.indexOf('rgb') === -1) {
                  return '';
              }
          Severity: Minor
          Found in src/styles/helpers/color/rgbToHsv.js - About 1 hr to fix

          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 useScrollControls has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function useScrollControls(scrollableRef) {
              const [showScrollUp, setShowScrollUp] = useState();
              const [showScrollDown, setShowScrollDown] = useState();
              const timer = useRef();
          
          

          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 Accordion has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          const Accordion = props => {
              const { id, children, style, className, activeSectionNames, multiple, onToggleSection } = props;
              const containerRef = useRef();
          
              const [activeNames, setActiveNames] = useState(activeSectionNames);
          Severity: Minor
          Found in src/components/Accordion/index.js - About 1 hr to fix

          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 handleChange has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              handleChange(optionName, isChecked) {
                  const { onChange, multiple, value } = this.props;
                  let currentValue = optionName;
                  if (multiple) {
                      if (!Array.isArray(value)) {
          Severity: Minor
          Found in src/components/VisualPicker/index.js - About 1 hr to fix

          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 PrimitiveMenu has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          const PrimitiveMenu = React.forwardRef((props, ref) => {
              const {
                  id,
                  className,
                  style,
          Severity: Minor
          Found in src/components/PrimitiveMenu/index.js - About 1 hr to fix

          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 extractTime has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function extractTime(date, hour24 = false) {
              if (date) {
                  const value = typeof date === 'string' ? new Date(date) : date;
                  if (!isValidDate(value)) {
                      return '';
          Severity: Minor
          Found in src/components/DateTimePicker/helpers/extractTime.js - About 1 hr to fix

          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 MinusIcon has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const MinusIcon = props => {
              const { className, style } = props;
          
              return (
                  <svg
          Severity: Minor
          Found in src/components/CounterInput/icons/minus.js - About 1 hr to fix

            Function NavigationButton has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function NavigationButton(props) {
                const { onClick, icon, disabled, dataId, ariaLabel, variant } = props;
            
                const handleOnClick = event => {
                    if (!disabled) {
            Severity: Minor
            Found in src/components/Pagination/navigationButton.js - About 1 hr to fix

              Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  render() {
                      const { minColumnWidth, maxColumnWidth, isResizable, ariaLabel } = this.props;
                      const { resizeBarStyle } = this.state;
              
                      return (
              Severity: Minor
              Found in src/components/Table/head/resizeBar.js - About 1 hr to fix

                Function Event has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function Event(props) {
                    const { onEventClick, locale, ...event } = props;
                    const { title, startDate, endDate, color, backgroundColor } = event;
                    const eventId = useUniqueIdentifier('calendar-event');
                    const duration = useEventDuration(startDate, endDate);
                Severity: Minor
                Found in src/components/WeeklyCalendar/week/event.js - About 1 hr to fix

                  Function VerticalNavigation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function VerticalNavigation(props) {
                      const {
                          id,
                          ariaLabel,
                          style,
                  Severity: Minor
                  Found in src/components/VerticalNavigation/index.js - About 1 hr to fix

                    Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        render() {
                            const { src, initials, title, icon, assistiveText, initialsVariant } = this.props;
                    
                            const { imageFailed } = this.state;
                            if (src && !imageFailed) {
                    Severity: Minor
                    Found in src/components/Avatar/avatarContent.js - About 1 hr to fix

                      Function UserAvatar has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const UserAvatar = props => {
                          const { className, style } = props;
                          return (
                              <svg
                                  className={className}
                      Severity: Minor
                      Found in library/exampleComponents/Icons/userAvatar.js - About 1 hr to fix

                        Function buildUnionTypeList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function buildUnionTypeList(data) {
                            return Object.keys(data).map(index => {
                                const type = data[index].name;
                                const value = data[index].value;
                        
                        
                          Severity
                          Category
                          Status
                          Source
                          Language