nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

Function InputItem has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function constructor has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        constructor(props) {
            super(props);
            const normalizedOptions = getNormalizedOptions(props.options || []);
            this.state = {
                searchValue: '',
    Severity: Minor
    Found in src/components/Lookup/index.js - About 1 hr to fix

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

          render() {
              const {
                  items,
                  value,
                  onSelectOption,
      Severity: Minor
      Found in src/components/Lookup/options/index.js - About 1 hr to fix

        Function StackoverflowIcon has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        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">
        Severity: Minor
        Found in library/styleguideComponents/RibbonRenderer/stackoverflowIcon.js - About 1 hr to fix

          Function HelpText has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          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');
          Severity: Minor
          Found in src/components/HelpText/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 getUpdatedRowsWhenDeselect has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function getUpdatedRowsWhenDeselect(params = {}) {
              const {
                  maxRowSelection,
                  rows = [],
                  indexes = {},
          Severity: Minor
          Found in src/components/Table/helpers/selector/getUpdatedRowsWhenDeselect.js - About 1 hr to fix

            Function SelectableCell has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function SelectableCell(props) {
                const { isSelected, isDisabled, tableId, onSelectRow, onDeselectRow, inputType } = props;
                const name = `${tableId}-options`;
                const isRadio = inputType === 'radio';
            
            
            Severity: Minor
            Found in src/components/Table/body/selectableCell.js - About 1 hr to fix

              Function InternalTooltip has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const InternalTooltip = React.forwardRef((props, ref) => {
                  const [pos, setPos] = useState();
                  const { className, style, children, isVisible, preferredPosition, triggerElementRef } = props;
                  const tooltipRef = useRef();
              
              
              Severity: Minor
              Found in src/components/InternalTooltip/index.js - About 1 hr to fix

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

                    render() {
                        const {
                            title,
                            tabIndex,
                            onClick,
                Severity: Minor
                Found in src/components/AvatarMenu/avatarButton.js - About 1 hr to fix

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

                      render() {
                          const {
                              id,
                              className,
                              style,
                  Severity: Minor
                  Found in src/components/ButtonGroupPicker/index.js - About 1 hr to fix

                    Function InputItems has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const InputItems = React.forwardRef((props, ref) => {
                        const {
                            value,
                            disabled,
                            required,
                    Severity: Minor
                    Found in src/components/CodeInput/inputItems.js - About 1 hr to fix

                      Function Hours has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const Hours = React.forwardRef((props, ref) => {
                          const { today, setToday, locale } = props;
                          const clock = useTimer();
                          useEffect(() => {
                              if (!isSameDay(today, clock)) {
                      Severity: Minor
                      Found in src/components/WeeklyCalendar/hours.js - About 1 hr to fix

                        Function CellValue has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function CellValue(props) {
                            const {
                                component: CellComponent,
                                value,
                                rowData,
                        Severity: Minor
                        Found in src/components/Table/body/cell.js - About 1 hr to fix

                          Function WeekDayItems has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const WeekDayItems = React.forwardRef((props, ref) => {
                              const {
                                  name,
                                  value,
                                  availableDates,
                          Severity: Minor
                          Found in src/components/WeekDayPicker/weekDayItems.js - About 1 hr to fix

                            Function ButtonOption has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function ButtonOption(props) {
                                const inputId = useUniqueIdentifier('button-option');
                                const { className, style, name, label, disabled, onClick } = props;
                            
                                const {
                            Severity: Minor
                            Found in src/components/ButtonOption/index.js - About 1 hr to fix

                              Function Spinner has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function Spinner(props) {
                                  const { className, style, assistiveText, isVisible, size, variant, type, children } = props;
                                  const currentSize = getSizeValue(size);
                              
                                  if (isVisible) {
                              Severity: Minor
                              Found in src/components/Spinner/index.js - About 1 hr to fix

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

                                    render() {
                                        const {
                                            style,
                                            label,
                                            labelAlignment,
                                Severity: Minor
                                Found in src/components/VisualPicker/index.js - About 1 hr to fix

                                  Function ClockIcon has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  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">
                                  Severity: Minor
                                  Found in src/components/TimePicker/icons/clock.js - About 1 hr to fix

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

                                        render() {
                                            const {
                                                label,
                                                style,
                                                className,
                                    Severity: Minor
                                    Found in src/components/Tab/index.js - About 1 hr to fix

                                      Function WeekDay has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const WeekDay = React.forwardRef((props, ref) => {
                                          const {
                                              name,
                                              value,
                                              locale,
                                      Severity: Minor
                                      Found in src/components/WeekDayPicker/weekDay.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language