mondora/mondora-website-front

View on GitHub

Showing 98 of 98 total issues

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

        participants: [{
            userId: $scope.user._id,
            name: $scope.user.profile.name,
            screenName: $scope.user.profile.screenName,
            pictureUrl: $scope.user.profile.pictureUrl
Severity: Major
Found in app/pages/today/today.js and 1 other location - About 1 hr to fix
app/pages/today/today.js on lines 250..255

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 72.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        link: function ($scope) {
            $scope.availableActions = Object.keys(AppMethods);
            $scope.menu = {
                // Move functions
                moveUp: function (index, event) {
Severity: Minor
Found in app/components/menu-editor/menu-editor.js - About 1 hr to fix

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

                    moveDown: function (index, event) {
                        event.stopPropagation();
                        var item = $scope.items[index];
                        $scope.items.splice(index, 1);
                        $scope.items.splice(index + 1, 0, item);
    Severity: Major
    Found in app/components/menu-editor/menu-editor.js and 1 other location - About 1 hr to fix
    app/components/menu-editor/menu-editor.js on lines 14..19

    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

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

                    moveUp: function (index, event) {
                        event.stopPropagation();
                        var item = $scope.items[index];
                        $scope.items.splice(index, 1);
                        $scope.items.splice(index - 1, 0, item);
    Severity: Major
    Found in app/components/menu-editor/menu-editor.js and 1 other location - About 1 hr to fix
    app/components/menu-editor/menu-editor.js on lines 20..25

    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

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

            link: function ($scope, $element, $attrs) {
    
                $scope.type = $attrs.type;
    
                $scope.getTitle = function () {
    Severity: Minor
    Found in app/components/post-card/post-card.js - About 1 hr to fix

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

              addedBy: {
                  userId: $scope.user._id,
                  name: $scope.user.profile.name,
                  screenName: $scope.user.profile.screenName,
                  pictureUrl: $scope.user.profile.pictureUrl
      Severity: Major
      Found in app/pages/today/today.js and 1 other location - About 1 hr to fix
      app/pages/today/today.js on lines 244..249

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

      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

              addedBy: {
                  userId: $scope.user._id,
                  name: $scope.user.profile.name,
                  screenName: $scope.user.profile.screenName,
                  pictureUrl: $scope.user.profile.pictureUrl
      Severity: Major
      Found in app/pages/today/today.js and 1 other location - About 1 hr to fix
      app/pages/today/today.js on lines 54..59

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

      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 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              link: function ($scope) {
                  $scope.delTag = function (index) {
                      var removedTags = $scope.tags.splice(index, 1);
                      if ($scope.onRemove()) {
                          $scope.onRemove()(removedTags[0]);
      Severity: Minor
      Found in app/components/tags/tags.js - About 1 hr to fix

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

                $rootScope.Posts.insert(post).remote.then(function (id) {
                    $state.go("postEdit", {postId: id});
                }, function (err) {
                    console.log(err);
                });
        Severity: Major
        Found in app/methods/methods.js and 1 other location - About 1 hr to fix
        app/methods/methods.js on lines 52..56

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

        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

                $rootScope.Channels.insert(channel).remote.then(function (id) {
                    $state.go("channelEdit", {channelNameOrId: id});
                }, function (err) {
                    console.log(err);
                });
        Severity: Major
        Found in app/methods/methods.js and 1 other location - About 1 hr to fix
        app/methods/methods.js on lines 28..32

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

        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.bodyEditorOptions = {
                placeholder: "Body",
                buttonLabels: "fontawesome",
                buttons: [
                    "bold",
        Severity: Major
        Found in app/pages/channel/edit/channelEdit.js and 1 other location - About 1 hr to fix
        app/pages/post/edit/postEdit.js on lines 103..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 68.

        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.bodyEditorOptions = {
                placeholder: "Body",
                buttonLabels: "fontawesome",
                buttons: [
                    "bold",
        Severity: Major
        Found in app/pages/post/edit/postEdit.js and 1 other location - About 1 hr to fix
        app/pages/channel/edit/channelEdit.js on lines 86..101

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

        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 setSeoTags has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var setSeoTags = function (values) {
        
                // Description
                var descriptionNodesSelector = [
                    "#meta-description",
        Severity: Minor
        Found in app/startup.js - About 1 hr to fix

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

          gulp.task("buildAppStaticPages", () => {
              return gulp.src("app/assets/static/*")
                  .pipe(gulp.dest("build/assets/static/"))
                  .pipe(browserSync.reload({stream: true}));
          });
          Severity: Major
          Found in gulpfile.js and 1 other location - About 1 hr to fix
          gulpfile.js on lines 63..67

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

          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

          gulp.task("buildAppImages", () => {
              return gulp.src("app/assets/images/*")
                  .pipe(gulp.dest("build/assets/images/"))
                  .pipe(browserSync.reload({stream: true}));
          });
          Severity: Major
          Found in gulpfile.js and 1 other location - About 1 hr to fix
          gulpfile.js on lines 69..73

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

          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.completedPomodoros = function () {
                  return $scope.selectedTask.pomodoros.filter(function (pomodoro) {
                      var status = pomodoro.status;
                      return status === "done" || status === "aborted";
                  });
          Severity: Major
          Found in app/pages/today/today.js and 1 other location - About 1 hr to fix
          app/pages/today/today.js on lines 142..147

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

          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.uncompletedPomodoros = function () {
                  return $scope.selectedTask.pomodoros.filter(function (pomodoro) {
                      var status = pomodoro.status;
                      return status !== "done" && status !== "aborted";
                  });
          Severity: Major
          Found in app/pages/today/today.js and 1 other location - About 1 hr to fix
          app/pages/today/today.js on lines 133..138

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

          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

                              day.eventRQ.on("change", function () {
                                  day.event = day.eventRQ.result[0];
                                  if (self.onChange) {
                                      self.onChange();
                                  }
          Severity: Major
          Found in app/components/coin-calendar/coin-calendar.js and 1 other location - About 1 hr to fix
          app/components/coin-calendar/coin-calendar.js on lines 109..114

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

          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

                              day.coinRQ.on("change", function () {
                                  day.coin = day.coinRQ.result[0];
                                  if (self.onChange) {
                                      self.onChange();
                                  }
          Severity: Major
          Found in app/components/coin-calendar/coin-calendar.js and 1 other location - About 1 hr to fix
          app/components/coin-calendar/coin-calendar.js on lines 121..126

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

          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 onFileSelect has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      $scope.onFileSelect = function (files) {
                          var file = files[0];
                          if (
                              $scope.fileType &&
                              !new RegExp($scope.fileType).test(file.type)
          Severity: Minor
          Found in app/components/s3-file-upload/s3-file-upload.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language