IIC2173-2015-2-Grupo2/GUI

View on GitHub

Showing 17 of 17 total issues

Function searchService has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function searchService($http, $window, $sessionStorage, $localStorage, $rootScope) {
    var vm = this;
    vm.newsPath = 'http://arqui8.ing.puc.cl/api/v1/private/news';
    vm.searchPath = 'http://arqui8.ing.puc.cl/api/v1/private/search';
    vm.tagsPath = 'http://arqui8.ing.puc.cl/api/v1/private/tags';
Severity: Major
Found in source/services/searchService.js - About 4 hrs to fix

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

        vm.getPeople = function() {
          return getRequest(vm.peoplePath)
                .success(function(data) { $localStorage.peopleList = _.uniq(data.people.map(vm.tagBuilder), JSON.stringify); })
                .then(function() { return vm.getLSPeople(); });
        };
    Severity: Major
    Found in source/services/searchService.js and 5 other locations - About 3 hrs to fix
    source/services/searchService.js on lines 78..82
    source/services/searchService.js on lines 84..88
    source/services/searchService.js on lines 90..94
    source/services/searchService.js on lines 102..106
    source/services/searchService.js on lines 108..112

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

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

        vm.getCompanies = function() {
          return getRequest(vm.companiesPath)
                .success(function(data) { $localStorage.companyList = _.uniq(data.companies.map(vm.tagBuilder), JSON.stringify); })
                .then(function() { return vm.getLSCompanies(); });
        };
    Severity: Major
    Found in source/services/searchService.js and 5 other locations - About 3 hrs to fix
    source/services/searchService.js on lines 78..82
    source/services/searchService.js on lines 84..88
    source/services/searchService.js on lines 90..94
    source/services/searchService.js on lines 96..100
    source/services/searchService.js on lines 102..106

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

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

        vm.getLocations = function() {
          return getRequest(vm.locationsPath)
                .success(function(data) { $localStorage.locationList = _.uniq(data.locations.map(vm.tagBuilder), JSON.stringify); })
                .then(function() { return vm.getLSLocations(); });
        };
    Severity: Major
    Found in source/services/searchService.js and 5 other locations - About 3 hrs to fix
    source/services/searchService.js on lines 78..82
    source/services/searchService.js on lines 84..88
    source/services/searchService.js on lines 90..94
    source/services/searchService.js on lines 96..100
    source/services/searchService.js on lines 108..112

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

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

        vm.getCategories = function() {
          return getRequest(vm.categoriesPath)
                .success(function(data) { $localStorage.categoryList = _.uniq(data.categories.map(vm.tagBuilder), JSON.stringify); })
                .then(function() { return vm.getLSCategories(); });
        };
    Severity: Major
    Found in source/services/searchService.js and 5 other locations - About 3 hrs to fix
    source/services/searchService.js on lines 78..82
    source/services/searchService.js on lines 84..88
    source/services/searchService.js on lines 96..100
    source/services/searchService.js on lines 102..106
    source/services/searchService.js on lines 108..112

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

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

        vm.getProviders = function() {
          return getRequest(vm.providersPath)
                .success(function(data) { $localStorage.providerList = _.uniq(data.news_providers.map(vm.tagBuilder), JSON.stringify); })
                .then(function() { return vm.getLSProviders(); });
        };
    Severity: Major
    Found in source/services/searchService.js and 5 other locations - About 3 hrs to fix
    source/services/searchService.js on lines 78..82
    source/services/searchService.js on lines 90..94
    source/services/searchService.js on lines 96..100
    source/services/searchService.js on lines 102..106
    source/services/searchService.js on lines 108..112

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

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

        vm.getTags = function() {
          return getRequest(vm.tagsPath)
                .success(function(data) { $localStorage.tagList = _.uniq(data.tags.map(vm.tagBuilder), JSON.stringify); })
                .then(function() { return vm.getLSTags(); });
        };
    Severity: Major
    Found in source/services/searchService.js and 5 other locations - About 3 hrs to fix
    source/services/searchService.js on lines 84..88
    source/services/searchService.js on lines 90..94
    source/services/searchService.js on lines 96..100
    source/services/searchService.js on lines 102..106
    source/services/searchService.js on lines 108..112

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

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

      function navbarController($rootScope, sessionService, searchService) {
        var vm = this;
        vm.session = {};
        getLSLists();
    
    
    Severity: Minor
    Found in source/directives/navbar.directive.js - About 1 hr to fix

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

        function sessionService($http, $window, $sessionStorage, $localStorage, $rootScope) {
          var vm = this;
      
          vm.login = function(userForm) {
            return $http({
      Severity: Minor
      Found in source/services/sessionService.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

              if (sessionService.loggedIn()) {
                vm.tagCollection      = vm.tagCollection      || searchService.getLSTags();
                vm.providerCollection = vm.providerCollection || searchService.getLSProviders();
                vm.categoryCollection = vm.categoryCollection || searchService.getLSCategories();
                vm.peopleCollection   = vm.peopleCollection   || searchService.getLSPeople();
        Severity: Major
        Found in source/directives/navbar.directive.js - About 1 hr to fix

          Function searchService has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            function searchService($http, $window, $sessionStorage, $localStorage, $rootScope) {
          Severity: Minor
          Found in source/services/searchService.js - About 35 mins to fix

            Function sessionService has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              function sessionService($http, $window, $sessionStorage, $localStorage, $rootScope) {
            Severity: Minor
            Found in source/services/sessionService.js - About 35 mins to fix

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

                      $http({
                        method: 'POST',
                        url: 'http://arqui8.ing.puc.cl/api/v1/auth/signup',
                        data: $.param(userForm),
                        headers: {'Content-Type': 'application/x-www-form-urlencoded'}
              Severity: Minor
              Found in source/services/signupService.js and 1 other location - About 30 mins to fix
              source/services/sessionService.js on lines 11..21

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

              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

                    return $http({
                      method: 'POST',
                      url: 'http://arqui8.ing.puc.cl/api/v1/auth/token',
                      data: $.param(userForm),
                      headers: {'Content-Type': 'application/x-www-form-urlencoded'}
              Severity: Minor
              Found in source/services/sessionService.js and 1 other location - About 30 mins to fix
              source/services/signupService.js on lines 10..22

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

              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

              Color literals like #fff should only be used in variable declarations; they should be referred to via variable everywhere else.
              Open

                color: #fff;

              Color literals like #fff should only be used in variable declarations; they should be referred to via variable everywhere else.
              Open

                  color: #fff;

              Color literals like #fff should only be used in variable declarations; they should be referred to via variable everywhere else.
              Open

                background: linear-gradient($gradient-initial, #fff);
              Severity
              Category
              Status
              Source
              Language