jjsoft-ar/jjsoft-api

View on GitHub

Showing 17 of 17 total issues

Method invalidRequest has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function invalidRequest(OAuthException $e)
    {
        if($e instanceof InvalidRequestException){
            return Response::make([
                'errors' => [
Severity: Minor
Found in src/Exceptions/OAuthExceptionHandler.php - About 1 hr to fix

    Method responseWithPaginator has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function responseWithPaginator($limit, $model, $transformer, $urlPath = null, array $append = null, array $parameters = [], Closure $after = null)
    Severity: Major
    Found in src/Traits/ResponderTrait.php - About 50 mins to fix

      Avoid variables with short names like $e. Configured minimum length is 3.
      Open

          public function handle(OAuthException $e)

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $e. Configured minimum length is 3.
      Open

          protected function invalidRequest(OAuthException $e)

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $e. Configured minimum length is 3.
      Open

          protected function invalidCredentials(OAuthException $e)

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $e. Configured minimum length is 3.
      Open

          protected function invalidClient($e){

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Missing class import via use statement (line '94', column '24').
      Open

                  return new \Dingo\Api\Auth\Provider\JWT($app['Tymon\JWTAuth\JWTAuth']);
      Severity: Minor
      Found in src/JJSoftApiServiceProvider.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Avoid using static access to class '\Response' in method 'invalidRequest'.
      Open

                  return Response::make([
                      'errors' => [
                          'status' => '400',
                          'code' => 'InvalidRefreshToken',
                          'title' => 'Invalid Refresh Token',

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid unused parameters such as '$exception'.
      Open

          public function handle(UnauthorizedHttpException $exception)

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid using static access to class '\Config' in method 'register'.
      Open

              \Config::set('jwt.user', \Config::get('auth.model'));
      Severity: Minor
      Found in src/JJSoftApiServiceProvider.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid unused parameters such as '$e'.
      Open

          protected function invalidCredentials(OAuthException $e)

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid using static access to class '\Response' in method 'handle'.
      Open

              return Response::make([
                  'errors' => [
                      'status' => '401',
                      'code' => 'AuthenticationFailed',
                      'title' => 'Authentication Failed',

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\Response' in method 'invalidRequest'.
      Open

                  return Response::make([
                      'errors' => [
                          'status' => '400',
                          'code' => 'InvalidRequest',
                          'title' => 'Invalid Request',

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\Response' in method 'invalidCredentials'.
      Open

              return Response::make([
                  'errors' => [
                      'status' => '401',
                      'code' => 'InvalidCredentials',
                      'title' => 'Invalid Credentials',

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid unused parameters such as '$e'.
      Open

          protected function invalidClient($e){

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid using static access to class '\Response' in method 'invalidClient'.
      Open

              return Response::make([
                  'errors' => [
                      'status' => '401',
                      'code' => 'InvalidClient',
                      'title' => 'Invalid Client',

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\Config' in method 'register'.
      Open

              \Config::set('jwt.user', \Config::get('auth.model'));
      Severity: Minor
      Found in src/JJSoftApiServiceProvider.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Severity
      Category
      Status
      Source
      Language