dustin-H/bauhaus-ui

View on GitHub

Showing 123 of 123 total issues

Avoid deeply nested control flow statements.
Open

          if (i === 'en') {
            break
          }
Severity: Major
Found in src/utils/i18n/index.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (newState.store[ln] == null) {
                  newState.store[ln] = {}
                }
    Severity: Major
    Found in src/reducers/i18n.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (id == null) {
                    console.warn('> Missing id!')
                  }
      Severity: Major
      Found in src/reducers/i18n.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (ln == null) {
                      console.warn('> Missing language!')
                    }
        Severity: Major
        Found in src/reducers/i18n.js - About 45 mins to fix

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

              case types.AUTH_LOGIN_ERROR:
                var newState = Object.assign({}, state)
                newState.error = true
                newState.loginLoading = false
                return newState
          Severity: Major
          Found in src/reducers/auth.js and 6 other locations - About 45 mins to fix
          src/reducers/auth.js on lines 25..29
          src/reducers/router.js on lines 28..32
          src/reducers/search.js on lines 25..29
          src/reducers/search.js on lines 43..47
          src/reducers/sideBar.js on lines 19..23
          src/reducers/sideBar.js on lines 24..28

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

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

              case types.ROUTER_SET_LOADING:
                var newState = Object.assign({}, state)
                newState.loading = true
                newState.error = false
                return newState
          Severity: Major
          Found in src/reducers/router.js and 6 other locations - About 45 mins to fix
          src/reducers/auth.js on lines 25..29
          src/reducers/auth.js on lines 41..45
          src/reducers/search.js on lines 25..29
          src/reducers/search.js on lines 43..47
          src/reducers/sideBar.js on lines 19..23
          src/reducers/sideBar.js on lines 24..28

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

          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 findModules has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export function findModules(obj) {
            var arr = []
            if (obj.name != null && typeof obj.name === 'string') {
              arr.push(obj.name)
              if (obj.components != null && typeof obj.components === 'object') {
          Severity: Minor
          Found in src/utils/moduleLoader/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

          Avoid deeply nested control flow statements.
          Open

                    if (pack[state.languages[i]].complete === true) {
                      isComplete = true
                      fallbacks.push(pack[state.languages[i]].url)
                      break
                    }
          Severity: Major
          Found in src/utils/i18n/index.js - About 45 mins to fix

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

                case types.SEARCH_SET_LOADING:
                  var newState = Object.assign({}, state)
                  newState.loading = true
                  newState.error = false
                  return newState
            Severity: Major
            Found in src/reducers/search.js and 6 other locations - About 45 mins to fix
            src/reducers/auth.js on lines 25..29
            src/reducers/auth.js on lines 41..45
            src/reducers/router.js on lines 28..32
            src/reducers/search.js on lines 43..47
            src/reducers/sideBar.js on lines 19..23
            src/reducers/sideBar.js on lines 24..28

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

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

                case types.SEARCH_SHOW_ERROR:
                  var newState = Object.assign({}, state)
                  newState.error = true
                  newState.loading = false
                  return newState
            Severity: Major
            Found in src/reducers/search.js and 6 other locations - About 45 mins to fix
            src/reducers/auth.js on lines 25..29
            src/reducers/auth.js on lines 41..45
            src/reducers/router.js on lines 28..32
            src/reducers/search.js on lines 25..29
            src/reducers/sideBar.js on lines 19..23
            src/reducers/sideBar.js on lines 24..28

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

            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 deeply nested control flow statements.
            Open

                      if (i === 'en') {
                        break
                      }
            Severity: Major
            Found in src/utils/i18n/index.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        if (pack[state.languages[i]].complete === true) {
                          isComplete = true
                          break
                        }
              Severity: Major
              Found in src/utils/i18n/index.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if (i === 'en') {
                            break
                          }
                Severity: Major
                Found in src/utils/i18n/index.js - About 45 mins to fix

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

                      case types.SIDEBAR_SET_LOADING:
                        var newState = Object.assign({}, state)
                        newState.loading = true
                        newState.error = false
                        return newState
                  Severity: Major
                  Found in src/reducers/sideBar.js and 6 other locations - About 45 mins to fix
                  src/reducers/auth.js on lines 25..29
                  src/reducers/auth.js on lines 41..45
                  src/reducers/router.js on lines 28..32
                  src/reducers/search.js on lines 25..29
                  src/reducers/search.js on lines 43..47
                  src/reducers/sideBar.js on lines 24..28

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

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

                      case types.SIDEBAR_SHOW_ERROR:
                        var newState = Object.assign({}, state)
                        newState.error = true
                        newState.loading = false
                        return newState
                  Severity: Major
                  Found in src/reducers/sideBar.js and 6 other locations - About 45 mins to fix
                  src/reducers/auth.js on lines 25..29
                  src/reducers/auth.js on lines 41..45
                  src/reducers/router.js on lines 28..32
                  src/reducers/search.js on lines 25..29
                  src/reducers/search.js on lines 43..47
                  src/reducers/sideBar.js on lines 19..23

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

                  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

                  Consider simplifying this complex logical expression.
                  Open

                        if (config.auth === true && state.auth.token != null && state.auth.token !== '' && state.auth.error === false && state.auth.header != null && state.auth.header !== '') {
                          request = request.set(state.auth.header, state.auth.token)
                        }
                  Severity: Major
                  Found in src/utils/helpers/superagentPlugin.js - About 40 mins to fix

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

                        if (state.loaded[urlArray[i]] == null) {
                          c++
                          loadLanguageByUrl(urlArray[i], function() {
                            c--
                            if (c < 1) {
                    Severity: Minor
                    Found in src/utils/i18n/loader.js and 1 other location - About 35 mins to fix
                    src/utils/i18n/index.js on lines 37..45

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

                    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

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

                      handleClick(e) {
                        const {actions, pathname} = this.props
                        actions
                          .router
                          .pushLocation({
                    Severity: Minor
                    Found in src/components/SideBarListElement/index.js and 1 other location - About 35 mins to fix
                    src/components/SearchElement/index.js on lines 6..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 47.

                    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

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

                      handleClick() {
                        const {actions, pathname} = this.props
                        actions.router.pushLocation({
                          pathname: pathname
                        })
                    Severity: Minor
                    Found in src/components/SearchElement/index.js and 1 other location - About 35 mins to fix
                    src/components/SideBarListElement/index.js on lines 6..13

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

                    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

                      for (var i in packs) {
                        k++
                        loadLanguages(packs[i], function() {
                          k--
                          if (k < 1) {
                    Severity: Minor
                    Found in src/utils/i18n/index.js and 1 other location - About 35 mins to fix
                    src/utils/i18n/loader.js on lines 40..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 47.

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language