BabylonJS/Spector.js

View on GitHub
extensions/background.js

Summary

Maintainability
C
1 day
Test Coverage

Avoid deeply nested control flow statements.
Open

                        for (var i = 0; i < infos.canvases.length; i++) {
                            var info = infos.canvases[i];
                            canvasesToSend.canvases.push({
                                id: info.id,
                                width: info.width,
Severity: Major
Found in extensions/background.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

            if (popup != null && popup.captureComplete) {
                popup.captureComplete();
            }
    Severity: Major
    Found in extensions/background.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

          else if (request.pageReload) {
              // Display the fps of the selected frame.
              var popup = window.browser.extension.getViews({ type: "popup" })[0];
              if (popup != null && popup.refreshCanvases) {
                  popup.refreshCanvases();
      Severity: Major
      Found in extensions/background.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                while (currentCommandChunks.length > 0) {
                    var curCommandChunk = '';
                    while (currentCommandChunks.length && currentCommandChunks[0].chunkIx === curCommandChunkIx) {
                        curCommandChunk += currentCommandChunks[0].chunk;
                        currentCommandChunks.shift();
        Severity: Major
        Found in extensions/background.js - About 45 mins to fix

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

          function sendMessage(message) {
              window.browser.tabs.query({ active: true, currentWindow: true }, function(tabs) { 
                  window.browser.tabs.sendMessage(tabs[0].id, message, function(response) { }); 
              });
          };
          Severity: Major
          Found in extensions/background.js and 2 other locations - About 2 hrs to fix
          extensions/popup.js on lines 10..14
          extensions/result.js on lines 13..17

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

          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

                  window.browser.tabs.create({ url: "result.html", active: true }, function(tab) {
                      resultTab = tab;
                      currentCapture = capture;
                      currentFrameId = frameId;
                      currentTabId = sender.tab.id;
          Severity: Major
          Found in extensions/background.js and 1 other location - About 1 hr to fix
          extensions/background.js on lines 122..127

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

          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

                  window.browser.tabs.create({ url: "result.html", active: true }, function(tab) {
                      resultTab = tab;
                      currentCapture = capture;
                      currentFrameId = frameId;
                      currentTabId = sender.tab.id;
          Severity: Major
          Found in extensions/background.js and 1 other location - About 1 hr to fix
          extensions/background.js on lines 160..165

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

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

          window.browser = (function () {
              return window.msBrowser ||
                  window.browser ||
                  window.chrome ||
                  browser;
          Severity: Major
          Found in extensions/background.js and 3 other locations - About 40 mins to fix
          extensions/contentScript.js on lines 4..9
          extensions/popup.js on lines 2..7
          extensions/result.js on lines 2..7

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

          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 = 0; i < commands.length; i++) {
                          capture.commands.push(commands[i]);
                      }
          Severity: Minor
          Found in extensions/background.js and 1 other location - About 35 mins to fix
          sample/js/renderTargetTexture.js on lines 31..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 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

          There are no issues that match your filters.

          Category
          Status