foothing/laravel-simple-pageviews

View on GitHub

Showing 7 of 7 total issues

Method parse has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function parse($startOrShortcut = null, $end = null) {
        if (! $startOrShortcut) {
            $startOrShortcut = 'currentYear';
        }

Severity: Major
Found in src/Parser.php - About 2 hrs to fix

    Avoid too many return statements within this method.
    Open

            return new DateFilter(
                'default',
                new Carbon($startOrShortcut),
                null
            );
    Severity: Major
    Found in src/Parser.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return new DateFilter(
                      $startOrShortcut,
                      Carbon::now()->startOfYear(),
                      Carbon::now()->endOfYear()
                  );
      Severity: Major
      Found in src/Parser.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return new DateFilter(
                        'default',
                        new Carbon($startOrShortcut),
                        new Carbon($end)
                    );
        Severity: Major
        Found in src/Parser.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return [
                          new Carbon($startOrShortcut),
                          new Carbon($end),
                      ];
          Severity: Major
          Found in src/Parser.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return [
                            Carbon::now()->startOfYear(),
                            Carbon::now()->endOfYear()
                        ];
            Severity: Major
            Found in src/Parser.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return [
                          new Carbon($startOrShortcut),
                          null
                      ];
              Severity: Major
              Found in src/Parser.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language