dasantonym/wdt

View on GitHub
src/js/controllers/appear-disappear.js

Summary

Maintainability
D
2 days
Test Coverage

Function onkeydown has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            document.onkeydown = function (e) {
                switch (e.keyCode) {
                    case 38: // up
                        $scope.weight = Math.min(1.0, $scope.weight + 0.005);
                        $scope.showOSD();
Severity: Minor
Found in src/js/controllers/appear-disappear.js - About 1 hr to fix

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

                window.onresize = function (e) {
                    var ww = window.innerWidth;
                    var wh = window.innerHeight;
    
                    var scale = Math.min(ww / width, wh / height);
    Severity: Major
    Found in src/js/controllers/appear-disappear.js and 2 other locations - About 6 hrs to fix
    src/js/controllers/capture-replay.js on lines 106..117
    src/js/controllers/space.js on lines 125..136

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

    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 y = 0; y < height; y += 1) {
                            for (var x = 0; x < width; x += 1) {
                                var pixel = mat.pixel(y, x);
                                var pos = (width * y + x) * 4;
                                image.data[pos] = pixel[2];
    Severity: Major
    Found in src/js/controllers/appear-disappear.js and 1 other location - About 6 hrs to fix
    src/js/controllers/space.js on lines 203..212

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

    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

                $scope.showOSD = function () {
                    $scope.OSDOpacity = 1;
                    if (!fade) {
                        fade = setInterval(function () {
                            $scope.OSDOpacity *= 0.9;
    Severity: Major
    Found in src/js/controllers/appear-disappear.js and 1 other location - About 3 hrs to fix
    src/js/controllers/space.js on lines 58..71

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

    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

                        case 67: // c:
                            try {
                                camDevice += 1;
                                cam.close();
                                cam = new cv.VideoCapture(camDevice);
    Severity: Major
    Found in src/js/controllers/appear-disappear.js and 1 other location - About 3 hrs to fix
    src/js/controllers/space.js on lines 159..170

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

    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

                        case 40: // down
                            $scope.weight = Math.max(0.005, $scope.weight - 0.005);
                            $scope.showOSD();
                            //threshold.set("threshold", $scope.threshold);
                            break;
    Severity: Major
    Found in src/js/controllers/appear-disappear.js and 3 other locations - About 40 mins to fix
    src/js/controllers/appear-disappear.js on lines 59..63
    src/js/controllers/space.js on lines 140..144
    src/js/controllers/space.js on lines 145..149

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

                        case 38: // up
                            $scope.weight = Math.min(1.0, $scope.weight + 0.005);
                            $scope.showOSD();
                            //threshold.set("threshold", $scope.threshold);
                            break;
    Severity: Major
    Found in src/js/controllers/appear-disappear.js and 3 other locations - About 40 mins to fix
    src/js/controllers/appear-disappear.js on lines 64..68
    src/js/controllers/space.js on lines 140..144
    src/js/controllers/space.js on lines 145..149

    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

    There are no issues that match your filters.

    Category
    Status