uPortal-Project/uportal-home

View on GitHub

Showing 73 of 73 total issues

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

      layoutService.getGuestMode().then(function(guest) {
        $scope.guestMode = guest;
        return guest;
      }).catch(function() {
        $log.warn('could not retrieve guest mode');
Severity: Major
Found in web/src/main/webapp/my-app/layout/static/controllers.js and 1 other location - About 1 hr to fix
web/src/main/webapp/my-app/layout/controllers.js on lines 541..547

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

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

        layoutService.getGuestMode().then(function(result) {
          $scope.guestMode = result;
          return result;
        })
        .catch(function() {
Severity: Major
Found in web/src/main/webapp/my-app/layout/controllers.js and 1 other location - About 1 hr to fix
web/src/main/webapp/my-app/layout/static/controllers.js on lines 65..70

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

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

        $scope.addToHome = function addToHome(portlet) {
          var fname = portlet.fname;
          var ret = layoutService.addToHome(portlet, $sessionStorage.layout);
          ret.then(
            function successCallback(response) {
Severity: Minor
Found in web/src/main/webapp/my-app/marketplace/controllers.js - About 1 hr to fix

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

           $scope.addToHome = function addToHome(portlet) {
            console.log("market: portlet", portlet);
              var fname = portlet.fname;
              var ret = layoutService.addToHome(portlet);
              console.log("market: fname", fname);
    Severity: Minor
    Found in web/src/main/webapp/my-app/marketplace/controllers.js - About 1 hr to fix

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

              vm.addToHome = function(portlet) {
                console.log("addToHome: pportlet", portlet);
                var ret = layoutService.addToHome(portlet);
                console.log("addToHome: ret", ret);
                ret.success(function(request, text) {
      Severity: Minor
      Found in web/src/main/webapp/my-app/layout/static/controllers.js - About 1 hr to fix

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

                      var persistAndUse = function(result) {
                        $log.log('persistAndUse: got data from old layout backend: ' +
                          result.data.layout);
                        var formattedOldLayout = formatLayoutForCache(result.data);
        
        
        Severity: Minor
        Found in web/src/main/webapp/my-app/layout/services.js - About 1 hr to fix

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

          define(['require'], function(require) {
            return {
              staticMax: {
                templateUrl: require.toUrl('./partials/static-content-max.html'),
              },
          Severity: Major
          Found in web/src/main/webapp/my-app/layout/static/routes.js and 1 other location - About 1 hr to fix
          web/src/main/webapp/my-app/marketplace/routes.js on lines 19..28

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

          define(['require'], function(require) {
              return {
                  main: {
                      templateUrl: require.toUrl('./partials/marketplace.html'),
                  },
          Severity: Major
          Found in web/src/main/webapp/my-app/marketplace/routes.js and 1 other location - About 1 hr to fix
          web/src/main/webapp/my-app/layout/static/routes.js on lines 19..28

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

                  vm.addToHome = function(portlet) {
                    var ret = layoutService.addToHome(portlet);
                    ret.success(function(request, text) {
                      angular.element('.fname-' + portlet.fname)
                        .html('<span style="color : green;">' +
          Severity: Minor
          Found in web/src/main/webapp/my-app/layout/static/controllers.js - About 1 hr to fix

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

                  $scope.moveWithKeyboard = function(widget, event) {
                    var result = $filter('filter')($scope.$parent.layout, widget);
                    var currentIndex = $scope.$parent.layout.indexOf(result[0]);
                    var previousIndex = currentIndex - 1;
                    var nextIndex = currentIndex + 1;
            Severity: Minor
            Found in web/src/main/webapp/my-app/layout/controllers.js - About 1 hr to fix

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

                      var getPortlets = function() {
                          return checkMarketplaceCache().then(function(data) {
                              var successFn;
                              var errorFn;
                              var defer;
              Severity: Minor
              Found in web/src/main/webapp/my-app/marketplace/services.js - About 1 hr to fix

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

                      $scope.moveWithKeyboard = function(widget, event) {
                        // Get index independent of ng-repeat to avoid filter bugs
                        var currentIndex =
                          findLayoutIndex($scope.layout, 'nodeId', widget.nodeId);
                        var previousIndex = currentIndex - 1;
                Severity: Minor
                Found in web/src/main/webapp/my-app/layout/controllers.js - About 1 hr to fix

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

                                if ($sessionStorage.marketplace != null) {
                                  // Filter for fname match in marketplace
                                  var marketplaceEntries = $filter('filter')(
                                    $sessionStorage.marketplace, fname
                                  );
                  Severity: Major
                  Found in web/src/main/webapp/my-app/layout/controllers.js and 1 other location - About 1 hr to fix
                  web/src/main/webapp/my-app/layout/controllers.js on lines 304..313

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

                  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 ($sessionStorage.marketplace != null) {
                                  // Filter for fname match in marketplace
                                  var marketplaceEntries = $filter('filter')(
                                    $sessionStorage.marketplace, fname
                                  );
                  Severity: Major
                  Found in web/src/main/webapp/my-app/layout/controllers.js and 1 other location - About 1 hr to fix
                  web/src/main/webapp/my-app/layout/controllers.js on lines 433..442

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

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

                        var init = function() {
                          // init variables
                          $scope.portlets = [];
                          marketplaceService.getPortlets().then(function(data) {
                            $scope.portlets = data.portlets;
                  Severity: Minor
                  Found in web/src/main/webapp/my-app/marketplace/controllers.js - About 1 hr to fix

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

                          var filterAppsBySearchTerm = function(apps) {
                            // Filter by title matches first
                            var appsWithMatchingTitle =
                              marketplaceService.filterPortletsBySearchTerm(
                                apps,
                    Severity: Minor
                    Found in web/src/main/webapp/my-app/search/controllers.js - About 1 hr to fix

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

                              var getExclusiveMarkup = function(portlet) {
                                return $http.get(SERVICE_LOC.context +
                                    '/p/' + portlet.fname + '/exclusive/render.uP', {cache: true})
                                    .then(function(result) {
                                        var data = result.data;
                      Severity: Minor
                      Found in web/src/main/webapp/my-app/layout/services.js - About 1 hr to fix

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

                                $scope.onSelect = function(portlet) {
                                  $location.path('apps/details/'+ portlet.fname);
                                  $scope.initialFilter = '';
                                  $scope.showSearch = false;
                                  $scope.showSearchFocus = false;
                        Severity: Major
                        Found in web/src/main/webapp/my-app/search/controllers.js and 1 other location - About 1 hr to fix
                        web/src/main/webapp/my-app/search/controllers.js on lines 64..69

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 55.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                  if ($scope.initialFilter != '') {
                                    $location.path('apps/search/'+ $scope.initialFilter);
                                    $scope.initialFilter = '';
                                    $scope.showSearch = false;
                                    $scope.showSearchFocus = false;
                        Severity: Major
                        Found in web/src/main/webapp/my-app/search/controllers.js and 1 other location - About 1 hr to fix
                        web/src/main/webapp/my-app/search/controllers.js on lines 56..61

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 55.

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

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

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

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

                        Refactorings

                        Further Reading

                        Function invokeCallback has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                function invokeCallback(expression, event, dropEffect, itemType, index, item) {
                        Severity: Minor
                        Found in web/src/main/webapp/js/dnd-lists.js - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language