lagranovskiy/j316-translator

View on GitHub

Showing 97 of 97 total issues

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

            translatorSocket.on('singinCompleted', function () {
                $log.info('Registration completed');
                isOnline = true;
                defer.resolve();
                translatorSocket.removeAllListeners('singinCompleted');
Severity: Major
Found in public/sender/js/service/TranslationService.js and 1 other location - About 1 hr to fix
public/consumer/js/service/TranslationService.js on lines 26..31

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

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 (sessionData.senderLanguage) {
                console.info('sender :: Signing in of already signed sender. clearing subscribtions');
                serviceDistributor.removeTranslationLanguage(sessionData.senderLanguage);
                socket.leave('lang_' + sessionData.senderLanguage);
            }
Severity: Major
Found in app/connector/SenderConnector.js and 1 other location - About 1 hr to fix
app/connector/ConsumerConnector.js on lines 117..121

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

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

        $scope.undo = function() {
            var last = TranslationService.getLast();
            if (last) {
                $scope.message.text = last;
            }
Severity: Major
Found in public/sender/js/controllers/TranslationController.js and 1 other location - About 1 hr to fix
public/sender/js/controllers/TranslationController.js on lines 357..362

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

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

        $scope.redo = function() {
            var next = TranslationService.getNext();
            if (next) {
                $scope.message.text = next;
            }
Severity: Major
Found in public/sender/js/controllers/TranslationController.js and 1 other location - About 1 hr to fix
public/sender/js/controllers/TranslationController.js on lines 347..352

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

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 (sessionData.clientLanguage) {
                console.info('client :: Signing in of already signed user. clearing subscribtions');
                serviceDistributor.removeTranslationLanguage(sessionData.clientLanguage);
                socket.leave('lang_' + sessionData.clientLanguage);
            }
Severity: Major
Found in app/connector/ConsumerConnector.js and 1 other location - About 1 hr to fix
app/connector/SenderConnector.js on lines 104..108

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

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

            wakeLock.request("system").then(
                function successFunction() {
                    $log.info('Preventing system to sleep is enabled');
                },
                function errorFunction() {
Severity: Major
Found in public/sender/js/controllers/TranslationController.js and 1 other location - About 1 hr to fix
public/sender/js/controllers/TranslationController.js on lines 429..435

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

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

        this.getRegistrationInfo = function () {
            var savedInfo = $cookies.getObject('j316-translation-control-reg');
            if (savedInfo) {
                registrationInfo = savedInfo;
                return registrationInfo;
Severity: Major
Found in public/sender/js/service/TranslationService.js and 2 other locations - About 1 hr to fix
public/consumer/js/service/TranslationService.js on lines 66..74
public/consumer/js/service/TranslationService.js on lines 96..105

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

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

        this.getSettings = function () {
            var savedInfo = $cookies.getObject('j316-translation-settings');

            if (savedInfo) {
                settings = savedInfo;
Severity: Major
Found in public/consumer/js/service/TranslationService.js and 2 other locations - About 1 hr to fix
public/consumer/js/service/TranslationService.js on lines 66..74
public/sender/js/service/TranslationService.js on lines 111..119

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

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

            wakeLock.request("display").then(
                function successFunction() {
                    $log.info('Preventing display to sleep is enabled');
                },
                function errorFunction() {
Severity: Major
Found in public/sender/js/controllers/TranslationController.js and 1 other location - About 1 hr to fix
public/sender/js/controllers/TranslationController.js on lines 437..444

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

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

        this.getRegistrationInfo = function () {
            var savedInfo = $cookies.getObject('j316-translation-reg');
            if (savedInfo) {
                registrationInfo = savedInfo;
                return registrationInfo;
Severity: Major
Found in public/consumer/js/service/TranslationService.js and 2 other locations - About 1 hr to fix
public/consumer/js/service/TranslationService.js on lines 96..105
public/sender/js/service/TranslationService.js on lines 111..119

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

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

        $rootScope.$on('socket:cachedTranslations', function(ev, data) {
            $log.debug('Cached Translation msg retrieved: ' + JSON.stringify(data));
            $rootScope.$broadcast('cachedTranslations', data);
        });
Severity: Major
Found in public/sender/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:newTranslation', function (ev, data) {
            $log.debug('Translation msg retrieved: ' + JSON.stringify(data));
            $rootScope.$broadcast('newTranslation', data);
        });
Severity: Major
Found in public/consumer/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:newTranslation', function(ev, data) {
            $log.debug('Translation msg retrieved: ' + JSON.stringify(data));
            $rootScope.$broadcast('newTranslation', data);
        });
Severity: Major
Found in public/sender/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:newQuestion', function(ev, data) {
            $log.debug('Question msg retrieved: ' + JSON.stringify(data));
            $rootScope.$broadcast('newQuestion', data);
        });
Severity: Major
Found in public/sender/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:info', function (ev, data) {
            $log.debug('Info msg retrieved: ' + JSON.stringify(data));
            $rootScope.$broadcast('info', data);
        });
Severity: Major
Found in public/consumer/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:error', function(ev, data) {
            $log.error('Error: ' + JSON.stringify(data));
            $rootScope.$broadcast('error', data);
        });
Severity: Major
Found in public/sender/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:newQuestionAnswer', function (ev, data) {
            $log.debug('Answer msg received: ' + JSON.stringify(data));
            $rootScope.$broadcast('newQuestionAnswer', data);
        });
Severity: Major
Found in public/consumer/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:cachedTranslations', function (ev, data) {
            $log.debug('Cached Translation msg retrieved: ' + JSON.stringify(data));
            $rootScope.$broadcast('cachedTranslations', data);
        });
Severity: Major
Found in public/consumer/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:listenersChanged', function(ev, data) {
            $log.debug('Listeners change detected: ' + JSON.stringify(data));
            $rootScope.$broadcast('listenersChanged', data);
        });
Severity: Major
Found in public/sender/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 86..89
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

        $rootScope.$on('socket:answerAck', function(ev, data) {
            $log.debug('answerAck msg received: ' + JSON.stringify(data));
            $rootScope.$broadcast('answerAck', data);
        });
Severity: Major
Found in public/sender/js/app.js and 12 other locations - About 55 mins to fix
public/consumer/js/app.js on lines 43..46
public/consumer/js/app.js on lines 62..65
public/consumer/js/app.js on lines 68..71
public/consumer/js/app.js on lines 74..77
public/consumer/js/app.js on lines 80..83
public/sender/js/app.js on lines 50..53
public/sender/js/app.js on lines 56..59
public/sender/js/app.js on lines 74..77
public/sender/js/app.js on lines 80..83
public/sender/js/app.js on lines 93..96
public/sender/js/app.js on lines 99..102
public/sender/js/app.js on lines 105..108

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

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

Severity
Category
Status
Source
Language