orizens/echoes-player

View on GitHub

Showing 15 of 70 total issues

PlayerSearchEffects has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

@Injectable()
export class PlayerSearchEffects {
  constructor(
    private actions$: Actions,
    private store: Store<EchoesState>,
Severity: Minor
Found in src/app/core/effects/player-search.effects.ts - About 3 hrs to fix

    Function appCore has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function appCore(
      state: IAppCore = initialState,
      action: AppActions
    ): IAppCore {
      switch (action.type) {
    Severity: Major
    Found in src/app/core/store/app-core/app-core.reducer.ts - About 2 hrs to fix

      UserProfileEffects has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Injectable()
      export class UserProfileEffects {
        constructor(
          private actions$: Actions,
          private userProfileActions: UserProfileActions,
      Severity: Minor
      Found in src/app/core/effects/user-profile.effects.ts - About 2 hrs to fix

        Function nowPlaylist has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function nowPlaylist(
          state: INowPlaylist = initialState,
          action: UnsafeAction
        ): INowPlaylist {
          switch (action.type) {
        Severity: Major
        Found in src/app/core/store/now-playlist/now-playlist.reducer.ts - About 2 hrs to fix

          Function search has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function search(
            state: IPlayerSearch = initialState,
            action: any
          ): IPlayerSearch {
            const { type, payload } = action;
          Severity: Major
          Found in src/app/core/store/player-search/player-search.reducer.ts - About 2 hrs to fix

            Function exports has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (config) {
              let options = {
                basePath: '',
                frameworks: ['jasmine', '@angular-devkit/build-angular'],
                plugins: [
            Severity: Minor
            Found in karma.conf.js - About 1 hr to fix

              Function constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                constructor(
                  private http: HttpClient,
                  private zone: NgZone,
                  private youtubeVideosInfo: YoutubeVideosInfo,
                  private authorization: Authorization
              Severity: Minor
              Found in src/app/core/services/user-profile.service.ts - About 1 hr to fix

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

                export function player(
                  state: IAppPlayer = initialPlayerState,
                  action: Actions
                ): IAppPlayer {
                  switch (action.type) {
                Severity: Minor
                Found in src/app/core/store/app-player/app-player.reducer.ts - About 1 hr to fix

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

                    fetchAllPlaylistItems(playlistId: string) {
                      let items = [];
                      const subscriptions: Subscription[] = [];
                      const items$ = new Subject();
                      let nextPageToken = '';
                  Severity: Minor
                  Found in src/app/core/services/user-profile.service.ts - About 1 hr to fix

                    Function search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function search(
                      state: IPlayerSearch = initialState,
                      action: any
                    ): IPlayerSearch {
                      const { type, payload } = action;
                    Severity: Minor
                    Found in src/app/core/store/player-search/player-search.reducer.ts - About 35 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Avoid too many return statements within this function.
                    Open

                          return {
                            ...state,
                            searchType: action.payload
                          };
                    Severity: Major
                    Found in src/app/core/store/player-search/player-search.reducer.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return {
                              ...state,
                              show: {
                                ...state.show,
                                addToPlaylist: action.payload,
                      Severity: Major
                      Found in src/app/core/store/app-core/app-core.reducer.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return { ...state, isSearching: true };
                        Severity: Major
                        Found in src/app/core/store/player-search/player-search.reducer.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return {
                                  ...state,
                                  error: {
                                    ...initialState.error
                                  }
                          Severity: Major
                          Found in src/app/core/store/app-core/app-core.reducer.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return {
                                    ...state,
                                    error: {
                                      ...initialState.error,
                                      show: false
                            Severity: Major
                            Found in src/app/core/store/app-core/app-core.reducer.ts - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language