eddiemoore/angular-spotify

View on GitHub
src/angular-spotify.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    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

      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

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

                  api: function (endpoint, method, params, data, headers) {
        Severity: Minor
        Found in src/angular-spotify.js - About 35 mins 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

          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

          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

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

                    unfollow: function (type, ids) {
                      return this.api('/me/following', 'DELETE', { type: type, ids: ids }, null, this._auth());
                    },
          Severity: Minor
          Found in src/angular-spotify.js and 2 other locations - About 30 mins to fix
          src/angular-spotify.js on lines 244..246
          src/angular-spotify.js on lines 252..254

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

                    userFollowingContains: function (type, ids) {
                      return this.api('/me/following/contains', 'GET', { type: type, ids: ids }, null, this._auth());
                    },
          Severity: Minor
          Found in src/angular-spotify.js and 2 other locations - About 30 mins to fix
          src/angular-spotify.js on lines 244..246
          src/angular-spotify.js on lines 248..250

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

                    follow: function (type, ids) {
                      return this.api('/me/following', 'PUT', { type: type, ids: ids }, null, this._auth());
                    },
          Severity: Minor
          Found in src/angular-spotify.js and 2 other locations - About 30 mins to fix
          src/angular-spotify.js on lines 248..250
          src/angular-spotify.js on lines 252..254

          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

          There are no issues that match your filters.

          Category
          Status