betajs/betajs-media-components

View on GitHub
src/dynamics/audio_player/player/states.js

Summary

Maintainability
D
2 days
Test Coverage

File states.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:AudioPlayer.Dynamics.PlayerStates.State", [
    "base:States.State",
    "base:Events.ListenMixin",
    "base:Objs"
], function(State, ListenMixin, Objs, scoped) {
Severity: Minor
Found in src/dynamics/audio_player/player/states.js - About 2 hrs to fix

    Function __loadAudio has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            __loadAudio: function() {
                this.listenOn(this.dyn, "error:audio", function() {
                    this.next("ErrorAudio");
                }, this);
                this.listenOn(this.dyn, "playing", function() {
    Severity: Minor
    Found in src/dynamics/audio_player/player/states.js - About 1 hr to fix

      Function _started has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _started: function() {
                  if (this.dyn.get("playlist")) {
                      var pl0, initialPlaylist;
                      var list = this.dyn.get("playlist");
                      var head = list.shift();
      Severity: Minor
      Found in src/dynamics/audio_player/player/states.js - About 1 hr to fix

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

                    this.listenOn(this.dyn, "playing", function() {
                        if (this.destroyed() || this.dyn.destroyed())
                            return;
                        if (this.dyn.get("autoseek"))
                            this.dyn.execute("seek", this.dyn.get("autoseek"));
        Severity: Major
        Found in src/dynamics/audio_player/player/states.js and 1 other location - About 3 hrs to fix
        src/dynamics/video_player/player/states.js on lines 654..660

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

        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

        Scoped.define("module:AudioPlayer.Dynamics.PlayerStates.FatalError", [
            "module:AudioPlayer.Dynamics.PlayerStates.State"
        ], function(State, scoped) {
            return State.extend({
                scoped: scoped
        Severity: Major
        Found in src/dynamics/audio_player/player/states.js and 1 other location - About 3 hrs to fix
        src/dynamics/video_player/player/states.js on lines 186..201

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

        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

                _started: function() {
                    this.listenOn(this.dyn, "error:attach", function() {
                        this.next("LoadError");
                    }, this);
                    this.listenOn(this.dyn, "attached", function() {
        Severity: Major
        Found in src/dynamics/audio_player/player/states.js and 1 other location - About 2 hrs to fix
        src/dynamics/video_player/player/states.js on lines 242..250

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

        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 (this.dyn.parent().record !== 'undefined' && this.dyn.parent().host !== 'undefined') {
                            this.dyn._isRecorder = true;
                            this.dyn._recorderDyn = this.dyn.parent();
                            this.dyn._recorderHost = this.dyn._recorderDyn.host;
                        }
        Severity: Major
        Found in src/dynamics/audio_player/player/states.js and 1 other location - About 1 hr to fix
        src/dynamics/video_player/player/states.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 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 2 locations. Consider refactoring.
        Open

                    if (this.dyn.get("playlist")) {
                        var pl0, initialPlaylist;
                        var list = this.dyn.get("playlist");
                        var head = list.shift();
                        this.dyn.get("initialoptions").playlist.push(head);
        Severity: Major
        Found in src/dynamics/audio_player/player/states.js and 1 other location - About 1 hr to fix
        src/dynamics/video_player/player/states.js on lines 903..935

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

        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

                    this.listenOn(this.dyn, "change:buffering", function() {
                        this.dyn.set("loader_active", this.dyn.get("buffering"));
                    }, this);
        Severity: Minor
        Found in src/dynamics/audio_player/player/states.js and 1 other location - About 50 mins to fix
        src/dynamics/video_player/player/states.js on lines 765..767

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

        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