mondora/mondora-website-front

View on GitHub

Showing 98 of 98 total issues

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

    $scope.save = function () {

        // Menu configuration
        menuConfig = angular.copy($scope.menuConfig);
        delete menuConfig._id;
Severity: Minor
Found in app/pages/admin/admin.js - About 1 hr to fix

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

            resolve: {
                channelSubId: ["$stateParams", "TimeoutPromiseService", "resumingLogin", function ($stateParams, TimeoutPromiseService, resumingLogin) {
                    var sub = Ceres.subscribe("singleChannel", $stateParams.channelNameOrId);
                    return TimeoutPromiseService.timeoutPromise(sub.ready, GIVE_UP_DELAY);
                }]
    Severity: Major
    Found in app/startup.js and 2 other locations - About 1 hr to fix
    app/startup.js on lines 389..394
    app/startup.js on lines 420..425

    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

            resolve: {
                postSubId: ["$stateParams", "TimeoutPromiseService", "resumingLogin", function ($stateParams, TimeoutPromiseService, resumingLogin) {
                    var sub = Ceres.subscribe("singlePost", $stateParams.postId);
                    return TimeoutPromiseService.timeoutPromise(sub.ready, GIVE_UP_DELAY);
                }]
    Severity: Major
    Found in app/startup.js and 2 other locations - About 1 hr to fix
    app/startup.js on lines 420..425
    app/startup.js on lines 461..466

    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

            resolve: {
                postSubId: ["$stateParams", "TimeoutPromiseService", "resumingLogin", function ($stateParams, TimeoutPromiseService, resumingLogin) {
                    var sub = Ceres.subscribe("singlePost", $stateParams.postId);
                    return TimeoutPromiseService.timeoutPromise(sub.ready, GIVE_UP_DELAY);
                }]
    Severity: Major
    Found in app/startup.js and 2 other locations - About 1 hr to fix
    app/startup.js on lines 389..394
    app/startup.js on lines 461..466

    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

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

            link: function ($scope, $element){
                // Save the size as number
                var size = parseInt($scope.size, 10);
                // Get acceptable border sizes
                var borderSize = size / 20;
    Severity: Minor
    Found in app/components/cig-image/cig-image.js - About 1 hr to fix

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

                  $scope.userBookmarkedPost = function () {
                      var bookmarksByPost = Tasks.reactiveQuery({"details.post._id": $scope.post._id}).result;
                      return bookmarksByPost.length > 0;
                  };
      Severity: Major
      Found in app/components/post-card/post-card.js and 1 other location - About 1 hr to fix
      app/pages/post/view/postView.js on lines 309..312

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

      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.userBookmarkedPost = function () {
              var bookmarksByPost = Tasks.reactiveQuery({"details.post._id": $scope.post._id}).result;
              return bookmarksByPost.length > 0;
          };
      Severity: Major
      Found in app/pages/post/view/postView.js and 1 other location - About 1 hr to fix
      app/components/post-card/post-card.js on lines 54..57

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

      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

      Function controller has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              controller: ["$scope", function ($scope) {
                  Ceres.subscribe("myCoins");
                  var Coins = Ceres.getCollection("coins");
                  var today = moment().utc().startOf("day").valueOf();
                  var coinsRQ = Coins.reactiveQuery({
      Severity: Minor
      Found in app/components/clock-in/clock-in.js - About 1 hr to fix

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

                link: function ($scope) {
                    $scope.form = $scope.form || {};
        
                    $scope.form.fields = $scope.form.fields || [];
                    $scope.addField = function () {
        Severity: Minor
        Found in app/components/form-builder/form-builder.js - About 1 hr to fix

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

                      $scope.addTag = function (e) {
                          if (e && e.type === "keyup") {
                              if ($scope.addingKeyCodes.indexOf(e.keyCode) === -1) {
                                  return;
                              }
          Severity: Minor
          Found in app/components/tags/tags.js - About 1 hr to fix

            Function getHolidays has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $scope.getHolidays = function (country) {
            
                    var selectedCountry = $scope.selected.country || country;
                    var selectedYear = $scope.selected.year;
            
            
            Severity: Minor
            Found in app/pages/calendar/calendar.js - About 1 hr to fix

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

                          authors: [{
                              userId: user._id,
                              screenName: user.profile.screenName,
                              name: user.profile.name,
                              pictureUrl: user.profile.pictureUrl
              Severity: Major
              Found in app/methods/methods.js and 1 other location - About 1 hr to fix
              app/methods/methods.js on lines 45..50

              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

                          curators: [{
                              userId: user._id,
                              screenName: user.profile.screenName,
                              name: user.profile.name,
                              pictureUrl: user.profile.pictureUrl
              Severity: Major
              Found in app/methods/methods.js and 1 other location - About 1 hr to fix
              app/methods/methods.js on lines 19..24

              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

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

                      link: function ($scope) {
                          $scope.permissions = $scope.permissions || {};
                          $scope.permissions.members = $scope.permissions.members || [];
                          $scope.member = {};
              
              
              Severity: Minor
              Found in app/components/permissions-editor/permissions-editor.js - About 1 hr to fix

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

                    url.facebook = [
                        "https://www.facebook.com/sharer.php?s=100",
                        "&p[title]=" + $scope.post.title,
                        "&p[url]=" + postUrl,
                        "&p[images][0]=" + $scope.post.titleImageUrl
                Severity: Minor
                Found in app/pages/post/view/postView.js and 1 other location - About 50 mins to fix
                app/pages/channel/view/channelView.js on lines 135..141

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

                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.pause = function () {
                        PomodoroService.pause($scope.selectedTask._id, $scope.selectedTask.pomodoros[0]._id, "No reason");
                    };
                Severity: Minor
                Found in app/pages/today/today.js and 1 other location - About 50 mins to fix
                app/pages/today/today.js on lines 165..167

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

                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

                    channelRQ.on("change", function () {
                        $scope.safeApply(function () {
                            $scope.channel = channelRQ.result[0];
                        });
                    });
                Severity: Minor
                Found in app/pages/channel/view/channelView.js and 1 other location - About 50 mins to fix
                app/pages/user/user.js on lines 19..23

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

                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

                    userRQ.on("change", function () {
                        $scope.safeApply(function () {
                            $scope.user = userRQ.result[0];
                        });
                    });
                Severity: Minor
                Found in app/pages/user/user.js and 1 other location - About 50 mins to fix
                app/pages/channel/view/channelView.js on lines 67..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 52.

                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

                    url.facebook = [
                        "https://www.facebook.com/sharer.php?s=100",
                        "&p[title]=" + $scope.channel.commonName,
                        "&p[url]=" + channelUrl,
                        "&p[images][0]=" + $scope.channel.mainImageUrl
                Severity: Minor
                Found in app/pages/channel/view/channelView.js and 1 other location - About 50 mins to fix
                app/pages/post/view/postView.js on lines 363..369

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

                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.abort = function () {
                        PomodoroService.abort($scope.selectedTask._id, $scope.selectedTask.pomodoros[0]._id, "No reason");
                    };
                Severity: Minor
                Found in app/pages/today/today.js and 1 other location - About 50 mins to fix
                app/pages/today/today.js on lines 162..164

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

                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