nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    return `rgb(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)})`;
Severity: Major
Found in src/styles/helpers/color/hsvToRgb.js and 1 other location - About 1 hr to fix
src/styles/helpers/color/rgbToHsv.js on lines 38..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    it('should return "PM" when value passed is a valid formatted time', () => {
        const values = ['01:32 PM', '11:02 PM', '05:00 PM', '10:19 PM'];
        values.forEach(value => expect(getAmPm(value)).toBe('PM'));
    });
Severity: Major
Found in src/components/TimePicker/helpers/__test__/getAmPm.spec.js and 1 other location - About 1 hr to fix
src/components/TimePicker/helpers/__test__/getAmPm.spec.js on lines 4..7

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <VerticalNavigation selectedItem="item-1">
                <VerticalSection label="Section Label">
                    <VerticalItem name="item-1" label="Recent" />
                    <VerticalItem name="item-2" label="Projects" />
                </VerticalSection>
src/components/VerticalNavigation/__test__/verticalNavigation.a11y.spec.js on lines 26..31

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const ErrorText = attachThemeAttrs(styled.div)`
    font-size: ${FONT_SIZE_TEXT_MEDIUM};
    margin-top: ${MARGIN_X_SMALL};
    align-self: ${getAlignSelf};
    color: ${props => props.palette.error.main};
Severity: Major
Found in src/components/Input/styled/errorText.js and 1 other location - About 1 hr to fix
src/components/Input/styled/helpText.js on lines 10..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    it('should return "AM" when value passed is a valid formatted time', () => {
        const values = ['01:32 AM', '11:02 AM', '05:00 AM', '10:19 AM'];
        values.forEach(value => expect(getAmPm(value)).toBe('AM'));
    });
Severity: Major
Found in src/components/TimePicker/helpers/__test__/getAmPm.spec.js and 1 other location - About 1 hr to fix
src/components/TimePicker/helpers/__test__/getAmPm.spec.js on lines 8..11

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const StyledInputHidden = attachThemeAttrs(styled(HiddenElement))`
    color: inherit;
    font: inherit;
    line-height: normal;
    box-sizing: border-box;
Severity: Major
Found in src/components/TimePicker/styled/inputHidden.js and 1 other location - About 1 hr to fix
src/components/VisualPickerOption/styled/checkmarkIcon.js on lines 5..12

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

jest.mock('../../../libs/counterManager', () => ({
    increment: jest.fn(),
    decrement: jest.fn(),
    hasModalsOpen: jest.fn(() => false),
}));
Severity: Major
Found in src/components/Drawer/__test__/drawer.spec.js and 1 other location - About 1 hr to fix
src/components/Modal/__test__/modal.spec.js on lines 14..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const StyledCheckmarkIcon = attachThemeAttrs(styled(CheckmarkIcon))`
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
Severity: Major
Found in src/components/VisualPickerOption/styled/checkmarkIcon.js and 1 other location - About 1 hr to fix
src/components/TimePicker/styled/inputHidden.js on lines 5..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    constructor(props) {
        super(props);
        this.inputId = uniqueId('picklist-input');
        this.errorMessageId = uniqueId('error-message');
        this.listboxId = uniqueId('listbox');
Severity: Minor
Found in src/components/Picklist/index.js - About 1 hr to fix

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

        render() {
            const { className, style, latitude, longitude, icon } = this.props;
            const { label, description } = this.state;
    
            if (latitude && longitude) {
    Severity: Minor
    Found in src/components/MapMarker/index.js - About 1 hr to fix

      Function StarHalf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function StarHalf() {
          return (
              <svg width="19px" height="18px" viewBox="0 0 19 18">
                  <defs>
                      <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
      Severity: Minor
      Found in src/components/Rating/starHalf.js - About 1 hr to fix

        Function Cancel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function Cancel(props) {
            const { className, style } = props;
            return (
                <svg
                    width="16px"
        Severity: Minor
        Found in src/components/Table/body/icons/cancel.js - About 1 hr to fix

          Function useMoveFocusedDayFunction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function useMoveFocusedDayFunction(focusedDate, currentMonth, minDate, maxDate) {
              return useCallback(
                  increment => {
                      const { minCalendarDate, maxCalendarDate } = getCalendarBounds(minDate, maxDate);
                      const nextFocusedDate = addDays(focusedDate, increment);
          Severity: Minor
          Found in src/components/Calendar/doubleCalendar/hooks/useMoveFocusedDay.js - About 1 hr to fix

            Function Month has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function Month(props) {
                const { firstDayMonth, value, minDate, maxDate, onChange } = props;
            
                const date = new Date(firstDayMonth);
                const lastDayMonth = getLastDayMonth(firstDayMonth);
            Severity: Minor
            Found in src/components/Calendar/month.js - About 1 hr to fix

              Function Notification has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function Notification(props) {
                  const { className, style, icon, title, description, onRequestClose, hideCloseButton } = props;
              
                  return (
                      <StyledContainer className={className} style={style}>
              Severity: Minor
              Found in src/components/Notification/index.js - About 1 hr to fix

                Function getTotalWidthsMetadata has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function getTotalWidthsMetadata(params) {
                    const { columns, minColumnWidth, maxColumnWidth } = params;
                    const initial = {
                        totalFixedWidth: 0,
                        totalFixedColumns: 0,
                Severity: Minor
                Found in src/components/Table/helpers/resizer/getTotalWidthsMetadata.js - About 1 hr to fix

                  Function Header has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const Header = React.forwardRef((props, ref) => {
                      const { week, today, locale } = props;
                      const formattedWeekDay = useFormatedWeekDay(locale);
                      const formattedNumberDay = useFormattedNumberDay(locale);
                  
                  
                  Severity: Minor
                  Found in src/components/WeeklyCalendar/header/index.js - About 1 hr to fix

                    Function MenuItems has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function MenuItems(props) {
                        const { items, onClick, focusedItemIndex, onHover } = props;
                    
                        return items.map((item, index) => {
                            const { label, description, icon, type } = item;
                    Severity: Minor
                    Found in src/components/Lookup/options/index.js - About 1 hr to fix

                      Function SearchIcon has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const SearchIcon = props => {
                          const { className } = props;
                          return (
                              <svg
                                  className={className}
                      Severity: Minor
                      Found in src/components/InternalDropdown/icons/searchIcon.js - About 1 hr to fix

                        Function Day has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function Day(props) {
                            const { date, firstDayMonth, isSelected, minDate, maxDate, onSelect } = props;
                            const { dateComponent } = useContext(MonthCalendarContext);
                            const day = date.getDate();
                            const isAdjacentDate = date.getMonth() !== firstDayMonth.getMonth();
                        Severity: Minor
                        Found in src/components/MonthlyCalendar/day.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language