toggle-corp/react-store

View on GitHub

Showing 110 of 110 total issues

Function controlledModalize has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring.
Open

export const controlledModalize = (WrappedButtonComponent) => {
    const ModalComponent = (props) => {
        const {
            disabled,
            modal,
Severity: Minor
Found in components/General/Modalize.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 FloatingContainer has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring.
Open

function FloatingContainer(props: Props) {
    const {
        children,
        className: classNameFromProps,
        closeOnEscape,
Severity: Minor
Found in v2/View/FloatingContainer/index.tsx - 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 createDays has a Cognitive Complexity of 19 (exceeds 10 allowed). Consider refactoring.
Open

    createDays({ year, month, value }) {
        const firstDate = new Date(year, month - 1, 1);
        const lastDate = new Date(year, month, 0);
        const selected = value && new Date(value);

Severity: Minor
Found in components/Input/DatePicker/DayPicker/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 render has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
Open

    render() {
        const {
            error,
            hint,
            keySelector,
Severity: Minor
Found in components/Input/SearchMultiSelectInput/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 ColorInput has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
Open

function ColorInput(props) {
    const {
        onChange,
        showHintAndError,
        label,
Severity: Minor
Found in components/Input/ColorInput/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 render has 111 lines of code (exceeds 100 allowed). Consider refactoring.
Open

    render() {
        const {
            error,
            hint,
            label,
Severity: Major
Found in components/Input/DateInput/index.js - About 1 hr to fix

    Function ConfirmOnClick has 111 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

    const ConfirmOnClick = (WrappedComponent) => {
        const ConfirmComponent = class extends React.PureComponent {
            static propTypes = propTypes;
    
            static defaultProps = defaultProps;
    Severity: Major
    Found in components/Action/ConfirmOnClick/index.js - About 1 hr to fix

      Function Image has 110 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

      function Image(props: Props) {
          const {
              alt,
              className: classNameFromProps,
              imageClassName,
      Severity: Major
      Found in v2/View/Image/index.tsx - About 1 hr to fix

        Function FloatingContainer has 108 lines of code (exceeds 100 allowed). Consider refactoring.
        Open

        function FloatingContainer(props: Props) {
            const {
                children,
                className: classNameFromProps,
                closeOnEscape,
        Severity: Major
        Found in v2/View/FloatingContainer/index.tsx - About 1 hr to fix

          Function createActionSyncMiddleware has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
          Open

          export const createActionSyncMiddleware = (actionPrefixes, tabId) => () => next => (action) => {
              const {
                  senderId,
                  resenderId,
                  type,
          Severity: Minor
          Found in utils/redux-sync.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 TreeNode has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
          Open

          function TreeNode<T, K extends OptionKey>(props: TreeNodeProps<T, K>) {
              const {
                  className,
                  disabled,
                  readOnly,
          Severity: Minor
          Found in v2/Input/TreeInput/index.tsx - 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 UNSAFE_componentWillReceiveProps has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.
          Open

              UNSAFE_componentWillReceiveProps(nextProps) {
                  const {
                      data: oldData,
                      boundingClientRect: oldBoundingClientRect,
                      clusterSize: oldClusterSize,
          Severity: Minor
          Found in components/Visualization/NewForceDirectedGraph/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 render has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
          Open

              render() {
                  const {
                      className: classNameFromProps,
                      data,
                      emptyComponent: EmptyComponent,
          Severity: Minor
          Found in components/View/List/ListView/index.js - About 45 mins 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 Calendar has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
          Open

          const Calendar = (props: CalendarProps) => {
              const {
                  className,
                  disabled,
                  onChange,
          Severity: Minor
          Found in v2/Input/NepaliDateInput/Calendar/index.tsx - About 45 mins 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 ListView has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
          Open

          function ListView<
              D,
              P,
              K extends OptionKey, GP, GK extends OptionKey,
          >(props: ListViewProps<D, P, K, GP, GK>) {
          Severity: Minor
          Found in v2/View/ListView/index.tsx - About 45 mins 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 UNSAFE_componentWillReceiveProps has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
          Open

              UNSAFE_componentWillReceiveProps(nextProps) {
                  const {
                      map: oldMap,
                      mapStyle: oldMapStyle,
                      layout: oldLayout,
          Severity: Minor
          Found in components/Visualization/Map/MapLayer/index.js - About 45 mins 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 useKeyboard has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
          Open

          function useKeyboard<T, Q extends OptionKey>(
              focusedKey: Q | undefined,
              selectedKey: Q | undefined,
              keySelector: (option: T) => Q,
              options: T[],
          Severity: Minor
          Found in v2/General/useKeyboard.ts - About 35 mins 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 renderChart has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
          Open

              renderChart() {
                  const {
                      boundingClientRect,
                      idSelector,
                      groupSelector,
          Severity: Minor
          Found in components/Visualization/ForceDirectedGraph/index.js - About 35 mins 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 renderChart has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
          Open

              renderChart() {
                  const {
                      data,
                      boundingClientRect,
                      childrenSelector,
          Severity: Minor
          Found in components/Visualization/RadialDendrogram/index.js - About 35 mins 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

          Avoid too many return statements within this function.
          Open

                  return (
                      <a
                          key={data}
                          className={className}
                          onClick={onClick}
          Severity: Major
          Found in components/View/ScrollTabs/index.js - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language