betajs/betajs-media

View on GitHub
src/image_recorder/image_recorder.js

Summary

Maintainability
D
1 day
Test Coverage

Function createSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

            createSnapshotDisplay: function(parent, snapshot, x, y, w, h) {},
Severity: Minor
Found in src/image_recorder/image_recorder.js - About 45 mins to fix

    Function updateSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                updateSnapshotDisplay: function(snapshot, display, x, y, w, h) {},
    Severity: Minor
    Found in src/image_recorder/image_recorder.js - About 45 mins to fix

      Function createSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  createSnapshotDisplay: function(parent, snapshot, x, y, w, h) {
      Severity: Minor
      Found in src/image_recorder/image_recorder.js - About 45 mins to fix

        Function updateSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    updateSnapshotDisplay: function(snapshot, image, x, y, w, h) {
        Severity: Minor
        Found in src/image_recorder/image_recorder.js - About 45 mins to fix

          Avoid too many return statements within this function.
          Open

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

            Avoid too many return statements within this function.
            Open

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

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

                              return Support.chromeExtensionMessage(ext.extensionId, {
                                  type: "ping",
                                  data: pingTest
                              }).mapError(function() {
                                  return err;
              Severity: Major
              Found in src/image_recorder/image_recorder.js and 1 other location - About 3 hrs to fix
              src/video_recorder/video_recorder.js on lines 447..456

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

              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

                          updateSnapshotDisplay: function(snapshot, image, x, y, w, h) {
                              image.style.left = x + "px";
                              image.style.top = y + "px";
                              image.style.width = w + "px";
                              image.style.height = h + "px";
              Severity: Major
              Found in src/image_recorder/image_recorder.js and 1 other location - About 2 hrs to fix
              src/video_recorder/video_recorder.js on lines 360..365

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

              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

                          enumerateDevices: function() {
                              return Support.enumerateMediaSources().success(function(result) {
                                  if (!this._currentVideo)
                                      this._currentVideo = Objs.ithKey(result.video);
                              }, this);
              Severity: Major
              Found in src/image_recorder/image_recorder.js and 1 other location - About 1 hr to fix
              src/audio_recorder/audio_recorder.js on lines 184..189

              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

                          constructor: function(options) {
                              inherited.constructor.call(this, options);
                              this._element = this._options.element;
                              this.ready = Promise.create();
                          },
              Severity: Major
              Found in src/image_recorder/image_recorder.js and 2 other locations - About 1 hr to fix
              src/audio_recorder/audio_recorder.js on lines 12..16
              src/video_recorder/video_recorder.js on lines 12..16

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

              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

                              if (Support.globals().supportedConstraints.mediaSource && Info.isFirefox() && Info.firefoxVersion() > 55)
                                  return true;
              Severity: Minor
              Found in src/image_recorder/image_recorder.js and 1 other location - About 40 mins to fix
              src/video_recorder/video_recorder.js on lines 542..543

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

                              if (this._element.tagName.toLowerCase() !== "video")
                                  this._element = Dom.changeTag(this._element, "video");
              Severity: Minor
              Found in src/image_recorder/image_recorder.js and 2 other locations - About 35 mins to fix
              src/audio_recorder/audio_recorder.js on lines 108..109
              src/video_recorder/video_recorder.js on lines 151..152

              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

              There are no issues that match your filters.

              Category
              Status