eddiemoore/angular-spotify

View on GitHub

Showing 34 of 34 total issues

Function $get has 340 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      this.$get = ['$q', '$http', '$window', function ($q, $http, $window) {

        function NgSpotify () {
          this.clientId = settings.clientId;
          this.redirectUri = settings.redirectUri;
Severity: Major
Found in src/angular-spotify.js - About 1 day to fix

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

              getArtists: function (artists) {
                artists = angular.isString(artists) ? artists.split(',') : artists;
                angular.forEach(artists, function (value, index) {
                  artists[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                });
    Severity: Major
    Found in src/angular-spotify.js and 1 other location - About 5 hrs to fix
    src/angular-spotify.js on lines 130..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 145.

    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

              getAlbums: function (albums) {
                albums = angular.isString(albums) ? albums.split(',') : albums;
                angular.forEach(albums, function (value, index) {
                  albums[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                });
    Severity: Major
    Found in src/angular-spotify.js and 1 other location - About 5 hrs to fix
    src/angular-spotify.js on lines 167..175

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

    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

              getTracksAudioFeatures: function (tracks) {
                tracks = angular.isString(tracks) ? tracks.split(',') : tracks;
                angular.forEach(tracks, function (value, index) {
                  tracks[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                });
    Severity: Major
    Found in src/angular-spotify.js and 1 other location - About 5 hrs to fix
    src/angular-spotify.js on lines 460..468

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

    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

              getTracks: function (tracks) {
                tracks = angular.isString(tracks) ? tracks.split(',') : tracks;
                angular.forEach(tracks, function (value, index) {
                  tracks[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                });
    Severity: Major
    Found in src/angular-spotify.js and 1 other location - About 5 hrs to fix
    src/angular-spotify.js on lines 475..483

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

    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

    File angular-spotify.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function (window, angular, undefined) {
      'use strict';
    
      angular
        .module('spotify', [])
    Severity: Minor
    Found in src/angular-spotify.js - About 5 hrs to fix

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

                removeUserAlbums: function (albums) {
                  albums = angular.isString(albums) ? albums.split(',') : albums;
                  angular.forEach(albums, function (value, index) {
                    albums[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                  });
      Severity: Major
      Found in src/angular-spotify.js and 1 other location - About 5 hrs to fix
      src/angular-spotify.js on lines 300..308

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

      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

                removeUserTracks: function (tracks) {
                  tracks = angular.isString(tracks) ? tracks.split(',') : tracks;
                  angular.forEach(tracks, function (value, index) {
                    tracks[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                  });
      Severity: Major
      Found in src/angular-spotify.js and 1 other location - About 5 hrs to fix
      src/angular-spotify.js on lines 324..332

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

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

                saveUserTracks: function (tracks) {
                  tracks = angular.isString(tracks) ? tracks.split(',') : tracks;
                  angular.forEach(tracks, function (value, index) {
                    tracks[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                  });
      Severity: Major
      Found in src/angular-spotify.js and 3 other locations - About 5 hrs to fix
      src/angular-spotify.js on lines 280..288
      src/angular-spotify.js on lines 310..318
      src/angular-spotify.js on lines 334..342

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

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

                saveUserAlbums: function (albums) {
                  albums = angular.isString(albums) ? albums.split(',') : albums;
                  angular.forEach(albums, function (value, index) {
                    albums[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                  });
      Severity: Major
      Found in src/angular-spotify.js and 3 other locations - About 5 hrs to fix
      src/angular-spotify.js on lines 280..288
      src/angular-spotify.js on lines 290..298
      src/angular-spotify.js on lines 334..342

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

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

                userTracksContains: function (tracks) {
                  tracks = angular.isString(tracks) ? tracks.split(',') : tracks;
                  angular.forEach(tracks, function (value, index) {
                    tracks[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                  });
      Severity: Major
      Found in src/angular-spotify.js and 3 other locations - About 5 hrs to fix
      src/angular-spotify.js on lines 290..298
      src/angular-spotify.js on lines 310..318
      src/angular-spotify.js on lines 334..342

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

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

                userAlbumsContains: function (albums) {
                  albums = angular.isString(albums) ? albums.split(',') : albums;
                  angular.forEach(albums, function (value, index) {
                    albums[index] = value.indexOf('spotify:') > -1 ? value.split(':')[2] : value;
                  });
      Severity: Major
      Found in src/angular-spotify.js and 3 other locations - About 5 hrs to fix
      src/angular-spotify.js on lines 280..288
      src/angular-spotify.js on lines 290..298
      src/angular-spotify.js on lines 310..318

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

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

      module.exports = function (grunt) {
      
        // Load grunt tasks automatically
        require('load-grunt-tasks')(grunt);
      
      
      Severity: Major
      Found in Gruntfile.js - About 2 hrs to fix

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

                  getAlbum: function (album) {
                    album = album.indexOf('spotify:') === -1 ? album : album.split(':')[2];
        
                    return this.api('/albums/' + album, 'GET', null, null, this._auth());
                  },
        Severity: Major
        Found in src/angular-spotify.js and 1 other location - About 2 hrs to fix
        src/angular-spotify.js on lines 158..162

        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

                  getArtist: function (artist) {
                    artist = artist.indexOf('spotify:') === -1 ? artist : artist.split(':')[2];
        
                    return this.api('/artists/' + artist, 'GET', null, null, this._auth());
                  },
        Severity: Major
        Found in src/angular-spotify.js and 1 other location - About 2 hrs to fix
        src/angular-spotify.js on lines 120..124

        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

                  getAlbumTracks: function (album, options) {
                    album = album.indexOf('spotify:') === -1 ? album : album.split(':')[2];
        
                    return this.api('/albums/' + album + '/tracks', 'GET', options, null, this._auth());
                  },
        Severity: Major
        Found in src/angular-spotify.js and 1 other location - About 2 hrs to fix
        src/angular-spotify.js on lines 178..182

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

        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

                  getArtistAlbums: function (artist, options) {
                    artist = artist.indexOf('spotify:') === -1 ? artist : artist.split(':')[2];
        
                    return this.api('/artists/' + artist + '/albums', 'GET', options, null, this._auth());
                  },
        Severity: Major
        Found in src/angular-spotify.js and 1 other location - About 2 hrs to fix
        src/angular-spotify.js on lines 144..148

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

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

                  login: function () {
                    var deferred = $q.defer();
                    var that = this;
        
                    var w = 400,
        Severity: Minor
        Found in src/angular-spotify.js - About 1 hr to fix

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

              Spotify.getAlbum('0sNOF9WDwhWunNAHPD3Baj').then(function (data){
                console.log('=================== Album - ID ===================');
                console.log(data);
              });
          Severity: Minor
          Found in examples/main.controller.js and 1 other location - About 50 mins to fix
          examples/main.controller.js on lines 31..34

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

          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

              Spotify.getAlbum('spotify:album:0sNOF9WDwhWunNAHPD3Baj').then(function (data){
                console.log('=================== Album - Spotify URI ===================');
                console.log(data);
              });
          Severity: Minor
          Found in examples/main.controller.js and 1 other location - About 50 mins to fix
          examples/main.controller.js on lines 26..29

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

          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

          Severity
          Category
          Status
          Source
          Language