CyberLight/react-typeahead2

View on GitHub
src/index.js

Summary

Maintainability
C
1 day
Test Coverage

File index.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { PureComponent } from 'react';
import debounce from 'lodash.debounce';
import trottle from 'lodash.throttle';
import styled from 'styled-components';
import Immutable from 'immutable';
Severity: Minor
Found in src/index.js - About 7 hrs to fix

    Typeahead has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Typeahead extends PureComponent {
    
      static defaultProps = {
        value: '',
        dropdownVisible: false,
    Severity: Minor
    Found in src/index.js - About 3 hrs to fix

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

        componentWillReceiveProps(nextProps) {
          const dir = getDirection(this._inputTypeAhead._input);
          const value = String(nextProps.value);
          const displayKey = nextProps.displayKey;
          const options = nextProps.options;
      Severity: Minor
      Found in src/index.js - About 1 hr to fix

        propType "height" is not required, but has no corresponding defaultProp declaration.
        Open

          height: React.PropTypes.number,
        Severity: Minor
        Found in src/index.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        propType "dir" is not required, but has no corresponding defaultProp declaration.
        Open

          dir: React.PropTypes.string,
        Severity: Minor
        Found in src/index.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        propType "className" is not required, but has no corresponding defaultProp declaration.
        Open

          className: React.PropTypes.string,
        Severity: Minor
        Found in src/index.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        Do not use Array index in keys
        Open

                          key={index}
        Severity: Minor
        Found in src/index.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        There are no issues that match your filters.

        Category
        Status