ayastreb/bandwidth-hero

View on GitHub

Showing 21 of 21 total issues

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

  render() {
    return (
      <Segment className="wrapper">
        <Header />
        <Segment basic attached>
Severity: Major
Found in src/setup/index.js - About 4 hrs to fix

    Function exports has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = env => {
    
    return{
      mode: env.NODE_ENV,
      devtool: 'inline-source-map',
    Severity: Major
    Found in webpack.config.js - About 3 hrs to fix

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

          if (!chrome.webRequest.onBeforeRequest.hasListener(onBeforeRequestListener)) {
              chrome.webRequest.onBeforeRequest.addListener(
                  onBeforeRequestListener,
                  {
                      urls: ['<all_urls>'],
      Severity: Major
      Found in src/background.js and 1 other location - About 2 hrs to fix
      src/background.js on lines 238..247

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

      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

          if (!chrome.webRequest.onCompleted.hasListener(onCompletedListener)) {
              chrome.webRequest.onCompleted.addListener(
                  onCompletedListener,
                  {
                      urls: ['<all_urls>'],
      Severity: Major
      Found in src/background.js and 1 other location - About 2 hrs to fix
      src/background.js on lines 227..236

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

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

      module.exports = (state: AppState) => {
        if (
          state.proxyUrl ===
          'https://wt-e9c9a7a436fcd9273a7f8890849dae65-0.run.webtask.io/bandwidth-hero-proxy'
        ) {
      Severity: Major
      Found in src/updates/1.1.8.js and 2 other locations - About 1 hr to fix
      src/updates/1.2.0.js on lines 5..13
      src/updates/1.2.1.js on lines 5..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 68.

      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

        convertBwWasChanged = () => {
          this.setState(prevState => {
              let convertBw = { convertBw: !prevState.convertBw }
              chrome.storage.local.set(convertBw)
              return convertBw
      Severity: Major
      Found in src/popup/index.js and 1 other location - About 1 hr to fix
      src/popup/index.js on lines 26..33

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

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

      module.exports = (state: AppState) => {
        if (
          state.proxyUrl ===
          'https://wt-e9c9a7a436fcd9273a7f8890849dae65-0.run.webtask.io/bandwidth-hero-proxy'
        ) {
      Severity: Major
      Found in src/updates/1.2.1.js and 2 other locations - About 1 hr to fix
      src/updates/1.1.8.js on lines 5..13
      src/updates/1.2.0.js on lines 5..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 68.

      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

        enableSwitchWasChanged = () => {
          this.setState(prevState => {
              let enabled = { enabled: !prevState.enabled }
              chrome.storage.local.set(enabled)
              return enabled
      Severity: Major
      Found in src/popup/index.js and 1 other location - About 1 hr to fix
      src/popup/index.js on lines 66..73

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

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

      module.exports = (state: AppState) => {
        if (
          state.proxyUrl ===
          'https://wt-e9c9a7a436fcd9273a7f8890849dae65-0.run.webtask.io/bandwidth-hero-proxy'
        ) {
      Severity: Major
      Found in src/updates/1.2.0.js and 2 other locations - About 1 hr to fix
      src/updates/1.1.8.js on lines 5..13
      src/updates/1.2.1.js on lines 5..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 68.

      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

        } else {
          return (
            <Segment attached>
              <Button content="Disable on this site" onClick={onSiteDisable} basic positive fluid />
            </Segment>
      Severity: Minor
      Found in src/components/DisableButton.js and 1 other location - About 40 mins to fix
      src/components/DisableButton.js on lines 9..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 49.

      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

        if (disabledHosts.includes(hostname)) {
          return (
            <Segment attached>
              <Button content="Enable on this site" onClick={onSiteEnable} basic negative fluid />
            </Segment>
      Severity: Minor
      Found in src/components/DisableButton.js and 1 other location - About 40 mins to fix
      src/components/DisableButton.js on lines 15..21

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

      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 false;
      Severity: Major
      Found in src/background/shouldCompress.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return false;
        Severity: Major
        Found in src/background/shouldCompress.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return false;
          Severity: Major
          Found in src/background/shouldCompress.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return false;
            Severity: Major
            Found in src/background/shouldCompress.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return false;
              Severity: Major
              Found in src/background/shouldCompress.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return true;
                Severity: Major
                Found in src/background/shouldCompress.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return false;
                  Severity: Major
                  Found in src/background/shouldCompress.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return false;
                    Severity: Major
                    Found in src/background/shouldCompress.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return false;
                      Severity: Major
                      Found in src/background/shouldCompress.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language