uPortal-Project/uportal-home

View on GitHub

Showing 73 of 73 total issues

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

      function getEventSearchURL() {
        return portalGroupService.getGroups().then(
          function(groups) {
            return getSearchURLS(groups).then(
              function(result) {
Severity: Major
Found in web/src/main/webapp/my-app/search/services.js and 2 other locations - About 2 hrs to fix
web/src/main/webapp/my-app/search/services.js on lines 230..244
web/src/main/webapp/my-app/search/services.js on lines 270..284

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

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

      function getHelpDeskHelpURL() {
        return portalGroupService.getGroups().then(
          function(groups) {
            return getSearchURLS(groups).then(
              function(result) {
Severity: Major
Found in web/src/main/webapp/my-app/search/services.js and 2 other locations - About 2 hrs to fix
web/src/main/webapp/my-app/search/services.js on lines 230..244
web/src/main/webapp/my-app/search/services.js on lines 250..264

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

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 (currentIndex !== 0) {
            // remove item from the list
            $scope.layout.splice(currentIndex, 1);
            // reinsert at new index
            $scope.layout.splice(previousIndex, 0, widget);
Severity: Major
Found in web/src/main/webapp/my-app/layout/controllers.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/layout/controllers.js on lines 280..292

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

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 (currentIndex !== $scope.layout.length - 1) {
            // remove item from the list
            $scope.layout.splice(currentIndex, 1);
            // reinsert at desired index
            $scope.layout.splice(nextIndex, 0, widget);
Severity: Major
Found in web/src/main/webapp/my-app/layout/controllers.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/layout/controllers.js on lines 259..273

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

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.openModal = function() {
               $mdDialog.show({
                   controller: 'RatingsModalController',
                   templateUrl: require.toUrl('./partials/rating-review.html'),
                   parent: angular.element($document.body),
Severity: Major
Found in web/src/main/webapp/my-app/rating/components.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/marketplace/controllers.js on lines 336..346

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

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.clickRatingReviewAdmin = function() {
          $mdDialog.show({
            controller: 'MarketplaceRatingReviewAdminController',
            templateUrl: require.toUrl('./partials/rating-review-admin.html'),
            parent: angular.element($document.body),
Severity: Major
Found in web/src/main/webapp/my-app/marketplace/controllers.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/rating/components.js on lines 41..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 82.

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

        var getUserRating = function(fname) {
            return $http.get(SERVICE_LOC.base + SERVICE_LOC.marketplace.base +
                fname + '/getRating', {cache: true})
              .then(function(result) {
                return result.data.rating;
Severity: Major
Found in web/src/main/webapp/my-app/marketplace/services.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/marketplace/services.js on lines 307..315

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

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

        var getAllRatings = function(fname) {
          return $http.get(
              SERVICE_LOC.base +
              SERVICE_LOC.marketplace.base + fname +
              '/ratings', {cache: true})
Severity: Major
Found in web/src/main/webapp/my-app/marketplace/services.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/marketplace/services.js on lines 182..188

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

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

      directorySearchService.directorySearchEnabled()
      .then(function(directoryEnabled) {
        $scope.directoryEnabled = directoryEnabled;
        if (directoryEnabled) {
          initDirectorySearch();
Severity: Major
Found in web/src/main/webapp/my-app/search/controllers.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/search/controllers.js on lines 264..273

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

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

      googleCustomSearchService.googleSearchEnabled()
      .then(function(googleSearchEnabled) {
        $scope.googleSearchEnabled = googleSearchEnabled;
        if (googleSearchEnabled) {
          initWiscEduSearch();
Severity: Major
Found in web/src/main/webapp/my-app/search/controllers.js and 1 other location - About 2 hrs to fix
web/src/main/webapp/my-app/search/controllers.js on lines 274..283

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

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

      var showConfirmationToast = function(data) {
        var widgetTitle = data.title;

        var accentColor = '';
        if ($sessionStorage.portal.theme) {
Severity: Minor
Found in web/src/main/webapp/my-app/layout/controllers.js - About 1 hr to fix

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

          var init = function() {
            initwiscDirectoryResultLimit();
            $scope.myuwResults = [];
            $scope.filteredApps = [];
            $scope.appDirectoryLoading = true;
    Severity: Minor
    Found in web/src/main/webapp/my-app/search/controllers.js - About 1 hr to fix

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

            var initDirectorySearch = function() {
              $scope.wiscDirectoryLoading = true;
              $scope.wiscDirectoryResultsBadge = '?';
              $scope.wiscDirectoryHopeForResults = true;
              directorySearchService.directorySearch($scope.searchTerm).then(
      Severity: Minor
      Found in web/src/main/webapp/my-app/search/controllers.js - About 1 hr to fix

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

                mainService.isGuest()
                .then(function(isGuest) {
                  if (isGuest) {
                    $scope.showAll = true;
                  }
        Severity: Major
        Found in web/src/main/webapp/my-app/marketplace/controllers.js and 1 other location - About 1 hr to fix
        web/src/main/webapp/my-app/search/controllers.js on lines 231..240

        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

                mainService.isGuest()
                  .then(function(isGuest) {
                    if (isGuest) {
                      $scope.showAll = true;
                    }
        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/marketplace/controllers.js on lines 276..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 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 exports has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(config) {
            config.set({
        
                basePath: './',
        
        
        Severity: Minor
        Found in web/src/main/webapp/karma.conf.js - About 1 hr to fix

          Function formatLayoutForCache has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var formatLayoutForCache = function(data) {
                    var result = {
                      'layout': [],
                    };
                    //  Check if there are duplicate fnames in data.layout
          Severity: Minor
          Found in web/src/main/webapp/my-app/layout/services.js - About 1 hr to fix

            Function googleSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function googleSearch(term) {
                    return getGoogleSearchURL().then(function(googleSearchURL) {
                      return $q(function(resolve, reject) {
                        if (googleSearchURL) {
                          return $http.get(googleSearchURL + '&q=' + term,
            Severity: Minor
            Found in web/src/main/webapp/my-app/search/services.js - About 1 hr to fix

              Function initializeConstants has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    vm.initializeConstants = function() {
                      var errorFn = function(name) {
                        return function() {
                          $log.warn('Could not ' + name);
                        };
              Severity: Minor
              Found in web/src/main/webapp/my-app/marketplace/controllers.js - About 1 hr to fix

                Function getPortlet has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var getPortlet = function(fname) {
                          var successFn;
                          var errorFn;
                          var defer;
                          // first check cache, if there use that (it'll be faster)
                Severity: Minor
                Found in web/src/main/webapp/my-app/marketplace/services.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language