gdbots/pbjx-php

View on GitHub
src/Util/StatusCodeUtil.php

Summary

Maintainability
D
1 day
Test Coverage

Method vendorToHttp has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function vendorToHttp(Code $code = Code::OK): HttpCode
    {
        if (Code::OK === $code) {
            return HttpCode::HTTP_OK;
        }
Severity: Minor
Found in src/Util/StatusCodeUtil.php - About 1 hr to fix

    Method httpToVendor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function httpToVendor(HttpCode $httpCode = HttpCode::HTTP_OK): Code
        {
            if ($httpCode->value < 400) {
                return Code::OK;
            }
    Severity: Minor
    Found in src/Util/StatusCodeUtil.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

                      return HttpCode::HTTP_FORBIDDEN;
      Severity: Major
      Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return HttpCode::HTTP_NOT_FOUND;
        Severity: Major
        Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return HttpCode::HTTP_NOT_IMPLEMENTED;
          Severity: Major
          Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return HttpCode::HTTP_GATEWAY_TIMEOUT;
            Severity: Major
            Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return Code::NOT_FOUND;
              Severity: Major
              Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return Code::PERMISSION_DENIED;
                Severity: Major
                Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return HttpCode::HTTP_UNAUTHORIZED;
                  Severity: Major
                  Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return HttpCode::HTTP_SERVICE_UNAVAILABLE;
                    Severity: Major
                    Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return HttpCode::HTTP_UNPROCESSABLE_ENTITY;
                      Severity: Major
                      Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return HttpCode::HTTP_PRECONDITION_FAILED;
                        Severity: Major
                        Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return Code::UNAUTHENTICATED;
                          Severity: Major
                          Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return Code::FAILED_PRECONDITION;
                            Severity: Major
                            Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return HttpCode::HTTP_CONFLICT;
                              Severity: Major
                              Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return HttpCode::HTTP_TOO_MANY_REQUESTS;
                                Severity: Major
                                Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return Code::OK;
                                  Severity: Major
                                  Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return Code::ALREADY_EXISTS;
                                    Severity: Major
                                    Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                          return Code::INTERNAL;
                                      Severity: Major
                                      Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                            return Code::INVALID_ARGUMENT;
                                        Severity: Major
                                        Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          return Code::RESOURCE_EXHAUSTED;
                                          Severity: Major
                                          Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                            return Code::UNAVAILABLE;
                                            Severity: Major
                                            Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                              return Code::UNIMPLEMENTED;
                                              Severity: Major
                                              Found in src/Util/StatusCodeUtil.php - About 30 mins to fix

                                                There are no issues that match your filters.

                                                Category
                                                Status