linagora/openpaas-esn

View on GitHub
frontend/js/modules/message.js

Summary

Maintainability
F
1 wk
Test Coverage

File message.js has 969 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

angular.module('esn.message')
  .constant('ESN_MESSAGE_TYPES', ['whatsup', 'event', 'poll'])
  .constant('ESN_MESSAGE_DEFAULT_POLL_CHOICES', [{ label: '' }, { label: '' }])
Severity: Major
Found in frontend/js/modules/message.js - About 2 days to fix

    Function sendMessage has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $scope.sendMessage = function() {
          if (!$scope.messageContent || $scope.messageContent.trim().length === 0) {
            $scope.displayError('You can not say nothing!');
    
    return;
    Severity: Major
    Found in frontend/js/modules/message.js - About 3 hrs to fix

      Function addComment has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $scope.addComment = function(objectType) {
            if ($scope.sending) {
              $scope.displayError('Client problem, unexpected action!');
      
      return;
      Severity: Major
      Found in frontend/js/modules/message.js - About 3 hrs to fix

        Function link has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function link(scope, element) {
              var results, choices;
        
              scope.showMeChart = false;
              scope.toggleChartDisplay = function() {
        Severity: Major
        Found in frontend/js/modules/message.js - About 2 hrs to fix

          Function link has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                link: function(scope) {
          
                  function updateShareTargets(target) {
                    if (!target) {
                      return;
          Severity: Minor
          Found in frontend/js/modules/message.js - About 1 hr to fix

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

                $scope.share = function() {
            
                  if (!$scope.activitystream) {
                    $log.debug('activitystream is required');
            
            
            Severity: Minor
            Found in frontend/js/modules/message.js - About 1 hr to fix

              Function updateShareTargets has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function updateShareTargets(target) {
                        if (!target) {
                          return;
                        }
              
              
              Severity: Minor
              Found in frontend/js/modules/message.js - About 1 hr to fix

                Function link has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function link(scope) {
                      scope.additionalData = {
                        pollChoices: angular.copy(ESN_MESSAGE_DEFAULT_POLL_CHOICES)
                      };
                
                
                Severity: Minor
                Found in frontend/js/modules/message.js - About 1 hr to fix

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

                      function addComment(objectType, data, inReplyTo, attachments) {
                        var payload = {};
                        payload.object = angular.copy(data);
                        payload.object.objectType = objectType;
                        payload.inReplyTo = inReplyTo;
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 4 hrs to fix
                  frontend/js/modules/message.js on lines 926..938

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

                  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

                      function post(objectType, data, targets, attachments) {
                        var payload = {};
                  
                        payload.object = angular.copy(data);
                        payload.object.objectType = objectType;
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 4 hrs to fix
                  frontend/js/modules/message.js on lines 940..951

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

                  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.onFileSelect = function($files) {
                        $scope.expand();
                        if (!$scope.uploadService) {
                          $scope.uploadService = fileUploadService.get();
                        }
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 4 hrs to fix
                  frontend/js/modules/message.js on lines 251..260

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

                  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.onFileSelect = function($files) {
                        $scope.expand();
                        if (!$scope.uploadService) {
                          $scope.uploadService = fileUploadService.get();
                        }
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 4 hrs to fix
                  frontend/js/modules/message.js on lines 70..79

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

                  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

                          var attachmentsModel = attachments.map(function(attachment) {
                            var type = attachment.file.type;
                            if (!type || type.length === 0) {
                              type = DEFAULT_FILE_TYPE;
                            }
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 4 hrs to fix
                  frontend/js/modules/message.js on lines 316..323

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

                  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

                          var attachmentsModel = attachments.map(function(attachment) {
                            var type = attachment.file.type;
                            if (!type || type.length === 0) {
                              type = DEFAULT_FILE_TYPE;
                            }
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 4 hrs to fix
                  frontend/js/modules/message.js on lines 132..139

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

                  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

                        $q.all(messageAttachmentHelper.deleteAttachments($scope.attachments)).then(function() {
                          $scope.attachments = [];
                          $scope.uploads = [];
                          $scope.complete = 0;
                        });
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 1 hr to fix
                  frontend/js/modules/message.js on lines 382..386

                  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

                        $q.all(messageAttachmentHelper.deleteAttachments($scope.attachments)).then(function() {
                          $scope.attachments = [];
                          $scope.uploads = [];
                          $scope.complete = 0;
                        });
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 1 hr to fix
                  frontend/js/modules/message.js on lines 207..211

                  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

                        if ($scope.position.coords) {
                          data.position = {
                            coords: {
                              latitude: $scope.position.coords.latitude,
                              longitude: $scope.position.coords.longitude
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 1 hr to fix
                  frontend/js/modules/message.js on lines 296..303

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

                  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 ($scope.position.coords) {
                          data.position = {
                            coords: {
                              latitude: $scope.position.coords.latitude,
                              longitude: $scope.position.coords.longitude
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 1 hr to fix
                  frontend/js/modules/message.js on lines 111..118

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

                  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

                      $scope.displayError = function(err) {
                        $alert({
                          content: err,
                          type: 'danger',
                          show: true,
                  Severity: Major
                  Found in frontend/js/modules/message.js and 2 other locations - About 1 hr to fix
                  frontend/js/modules/activitystream/controllers.js on lines 9..19
                  frontend/js/modules/message.js on lines 875..885

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

                  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

                      $scope.displayError = function(err) {
                        $alert({
                          content: err,
                          type: 'danger',
                          show: true,
                  Severity: Major
                  Found in frontend/js/modules/message.js and 2 other locations - About 1 hr to fix
                  frontend/js/modules/activitystream/controllers.js on lines 9..19
                  frontend/js/modules/message.js on lines 222..232

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

                  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.removeFile = function(file) {
                        $scope.attachments = $scope.attachments.filter(function(attachment) {
                          return attachment.file !== file;
                        });
                      };
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 1 hr to fix
                  frontend/js/modules/message.js on lines 262..266

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

                  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.removeFile = function(file) {
                        $scope.attachments = $scope.attachments.filter(function(attachment) {
                          return attachment.file !== file;
                        });
                      };
                  Severity: Major
                  Found in frontend/js/modules/message.js and 1 other location - About 1 hr to fix
                  frontend/js/modules/message.js on lines 81..85

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

                  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 (!$scope.commentContent || $scope.commentContent.trim().length === 0) {
                          $scope.displayError('You can not say nothing!');
                  
                  return;
                        }
                  Severity: Minor
                  Found in frontend/js/modules/message.js and 1 other location - About 40 mins to fix
                  frontend/js/modules/message.js on lines 88..92

                  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

                      $scope.removeShare = function(target) {
                        $scope.shares = $scope.shares.filter(function(share) {
                          return share.uuid !== target.uuid;
                        });
                      };
                  Severity: Minor
                  Found in frontend/js/modules/message.js and 1 other location - About 40 mins to fix
                  frontend/js/modules/collaboration/members/list/collaboration-members-list.controller.js on lines 47..51

                  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

                        if (!$scope.messageContent || $scope.messageContent.trim().length === 0) {
                          $scope.displayError('You can not say nothing!');
                  
                  return;
                        }
                  Severity: Minor
                  Found in frontend/js/modules/message.js and 1 other location - About 40 mins to fix
                  frontend/js/modules/message.js on lines 281..285

                  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

                            if (err.data.status === 403) {
                              $scope.displayError('You do not have enough rights to write a new message here');
                            } else {
                              $scope.displayError('Error while sharing your whatsup message');
                            }
                  Severity: Minor
                  Found in frontend/js/modules/message.js and 1 other location - About 30 mins to fix
                  frontend/js/modules/message.js on lines 358..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 45.

                  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 (err.data.status === 403) {
                              $scope.displayError('You do not have enough rights to write a response here');
                            } else {
                              $scope.displayError('Error while adding comment');
                            }
                  Severity: Minor
                  Found in frontend/js/modules/message.js and 1 other location - About 30 mins to fix
                  frontend/js/modules/message.js on lines 178..182

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

                  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