mondora/mondora-website-front

View on GitHub

Showing 19 of 98 total issues

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

        link: function ($scope, $element) {
            var updateContent = function () {
                if ($scope.dontUpdate) return;
                $scope.$root.safeApply(function () {
                    $scope.content = $element.html();
Severity: Major
Found in app/components/medium-editor/medium-editor.js - About 1 day to fix

    File startup.js has 497 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var GIVE_UP_DELAY = 30000;
    
    (function () {
    
        var deferred = Q.defer();
    Severity: Minor
    Found in app/startup.js - About 7 hrs to fix

      File postView.js has 340 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      angular.module("mnd-web.pages")
      
      .factory("firstLevelHtmlParser", [function () {
          var parse = function (html) {
              var div = document.createElement("div");
      Severity: Minor
      Found in app/pages/post/view/postView.js - About 4 hrs to fix

        Function _update has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this._update = function () {
                var self = this;
                //Reset the calendar
                self.weeks = [];
                // Build the calendar object
        Severity: Major
        Found in app/components/coin-calendar/coin-calendar.js - About 2 hrs to fix

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

                  link: function ($scope, $element) {
          
                      ///////////
                      // Setup //
                      ///////////
          Severity: Major
          Found in app/components/pomodoro/pomodoro.js - About 2 hrs to fix

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

                    link: function ($scope, $element) {
            
                        // AmazonS3Config
                        var amazonS3Config = $scope.$root.Configurations.reactiveQuery({name: "amazonS3"}).result[0];
            
            
            Severity: Minor
            Found in app/components/s3-file-upload/s3-file-upload.js - About 1 hr to fix

              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

                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

                  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

                    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

                      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

                        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

                          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

                            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

                                    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

                                      Function bind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      /* */        Function.prototype.bind = function (oThis) {
                                      /* */            if (typeof this !== "function") {
                                      /* */                throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
                                      /* */            }
                                      /* */            var aArgs = Array.prototype.slice.call(arguments, 1);
                                      Severity: Minor
                                      Found in app/main.js - About 25 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language