mahaplatform/reframe

View on GitHub

Showing 358 of 358 total issues

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

    return {
      format,
      chosen,
      multiple,
      text,
Severity: Minor
Found in src/controls/toggle_list/toggle_list.js and 1 other location - About 35 mins to fix
src/controls/textarea/index.js on lines 79..86

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 46.

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 3 locations. Consider refactoring.
Open

          <div key={`result_${index}`} className="reframe-search-item" onClick={ this._handleChoose.bind(this, option) }>
            <Format { ...option.record } format={ format } value={ option.text } />
          </div>
Severity: Minor
Found in src/components/search2/options.js and 2 other locations - About 35 mins to fix
src/components/filters/saved.js on lines 27..35
src/components/search/options.js on lines 12..19

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 46.

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 3 locations. Consider refactoring.
Open

      <CSSTransition key="reframe-tray-panel" in={ open } classNames="expanded" timeout={ 500 } mountOnEnter={ true } unmountOnExit={ true }>
        <div className="reframe-tray-panel">
          { _.isFunction(component) ? React.createElement(component) : component }
        </div>
      </CSSTransition>
Severity: Minor
Found in src/containers/tray/tray.js and 2 other locations - About 35 mins to fix
src/components/panel/index.js on lines 23..27
src/containers/modal/modal.js on lines 44..48

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 46.

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

Avoid too many return statements within this function.
Open

        return Check(this.props, true)
Severity: Major
Found in src/utils/format/index.js - About 30 mins to fix

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

      render() {
        return (
          <div className="ui field">
            <input { ...this._getInput() }/>
          </div>
    Severity: Minor
    Found in src/controls/emailfield/index.js and 2 other locations - About 30 mins to fix
    src/controls/numberfield/index.js on lines 26..32
    src/controls/phonefield/index.js on lines 26..32

    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 45.

    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

    Avoid too many return statements within this function.
    Open

          return 0
    Severity: Major
    Found in src/components/collection/selectors.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return Check(this.props, false)
      Severity: Major
      Found in src/utils/format/index.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return Default(this.props)
        Severity: Major
        Found in src/utils/format/index.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return { $eq: value }
          Severity: Major
          Found in src/components/filters/selectors.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return Email(this.props)
            Severity: Major
            Found in src/utils/format/index.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return Link(this.props)
              Severity: Major
              Found in src/utils/format/index.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return 'file-text-o'
                Severity: Major
                Found in src/controls/filefield/plain_file_token.js - About 30 mins to fix

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

                    render() {
                      return (
                        <div className="ui field">
                          <input { ...this._getInput() }/>
                        </div>
                  Severity: Minor
                  Found in src/controls/phonefield/index.js and 2 other locations - About 30 mins to fix
                  src/controls/emailfield/index.js on lines 20..26
                  src/controls/numberfield/index.js on lines 26..32

                  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 45.

                  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

                  Avoid too many return statements within this function.
                  Open

                          return Raw(this.props)
                  Severity: Major
                  Found in src/utils/format/index.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        if(index < cardIndexes ) return 'covered'
                    Severity: Major
                    Found in src/components/stack/stack.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return Element(this.props)
                      Severity: Major
                      Found in src/utils/format/index.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return Date(this.props, template)
                        Severity: Major
                        Found in src/utils/format/index.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return format(this.props)
                          Severity: Major
                          Found in src/utils/format/index.js - About 30 mins to fix

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

                            export const fetchSections = (endpoint) => ({
                              type: 'API_REQUEST',
                              method: 'GET',
                              endpoint,
                              request: 'FETCH_SECTIONS_REQUEST',
                            Severity: Minor
                            Found in src/components/form/actions.js and 1 other location - About 30 mins to fix
                            src/controls/select/actions.js on lines 1..8

                            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 45.

                            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

                            Avoid too many return statements within this function.
                            Open

                                  return Default(this.props)
                            Severity: Major
                            Found in src/utils/format/index.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language