Feature/customer rest api#22
Conversation
|
Issues
======
+ Solved 2
- Added 379
Complexity increasing per file
==============================
- customer_service/lib/FileManager/FileType/FileTypeHandler.php 6
- customer_service/lib/ErrorReporter/ObjectError.php 1
- customer_service/lib/ResponseBuilder/JsonResponseBuilder.php 8
- customer_service/lib/EmailManager/PHPMailerEmailAPI.php 4
- customer_service/lib/FileManager/FileCreator/FileCreatorHandler.php 6
- customer_service/lib/DatabaseManager/DatabaseManager.php 2
- customer_service/lib/FileManager/FileManager.php 1
- customer_service/lib/FileManager/FileFormatter/FileFormatterFactory.php 1
- customer_service/lib/FileManager/FileFormatter/Image/JPEGImageFileFormatter.php 3
- customer_service/lib/ResponseBuilder/JsonHandler.php 1
- customer_service/lib/EmailManager/ResetPasswordEmailContent.php 3
- customer_service/lib/FileManager/File/PersistFileHandler.php 6
- customer_service/lib/FileManager/FileFormatter/FileFormatterPool.php 4
- customer_service/lib/FileUploadManager/FileUploadManager.php 1
- customer_service/lib/EmailManager/EmailManager.php 2
- customer_service/lib/EmailManager/SMTPEmailConnection.php 1
- customer_service/lib/FileUploadManager/MultipleFileUploader.php 5
- customer_service/lib/FileManager/FileGroup/FileGroupHandler.php 6
- customer_service/lib/FileUploadManager/SingleFileUploader.php 3
- customer_service/src/Services/CustomerService.php 2
- customer_service/lib/EmailManager/SignupEmailContent.php 3
- customer_service/lib/FileManager/FileType/FileType.php 1
- customer_service/lib/ResponseBuilder/JsonClientResponseArray.php 3
- customer_service/src/Repositories/CustomerSessionRepository.php 6
- customer_service/src/Controllers/CustomerController.php 6
- customer_service/lib/EmailManager/SMTPEmailConnectionFactory.php 1
- customer_service/src/Models/CustomerModel.php 3
- customer_service/src/Services/CustomerSessionService.php 3
- customer_service/lib/ErrorReporter/PersistenceError.php 1
- customer_service/src/Controllers/CustomerSessionController.php 4
- customer_service/lib/ErrorReporter/ErrorReporter.php 2
- customer_service/lib/FileManager/File/LogicFile.php 2
- customer_service/lib/FileManager/FileGroup/FileGroup.php 1
- customer_service/lib/ErrorReporter/EmptyError.php 1
- customer_service/lib/FileManager/File/PersistFile.php 1
- customer_service/src/Repositories/CustomerRepository.php 8
- customer_service/lib/ResponseBuilder/JsonClientResponseData.php 3
- customer_service/src/Models/CustomerSessionModel.php 1
- customer_service/src/Controllers/ApplicationController.php 1
- customer_service/lib/FileManager/FileCreator/FileCreator.php 1
- customer_service/lib/ErrorReporter/ErrorNodeFactory.php 1
- customer_service/lib/ErrorReporter/Errors.php 2
Clones added
============
- customer_service/lib/EmailManager/ResetPasswordEmailContent.php 1
- customer_service/lib/FileUploadManager/MultipleFileUploader.php 1
- customer_service/lib/FileUploadManager/SingleFileUploader.php 1
- customer_service/lib/EmailManager/SignupEmailContent.php 1
See the complete overview on Codacy |
|
|
||
| if ($this->customer === null) { | ||
| $responseData->addValue("href", "app/customers"); | ||
| echo $responseBuilder->setName("resetcustomerpassword") |
There was a problem hiding this comment.
| SET vhTimeOut = NULL; | ||
| SET vhTimeLastCheck = NOW(); | ||
| SET chCheckState = chStartState; | ||
| SET chEndState = NULL; |
There was a problem hiding this comment.
Issue found: syntax error at or near "NULL"
| $errorMessages = $errorMessages.$jsonHandler->quoteString("errors") | ||
| ." : [{". | ||
| $jsonHandler->quoteString("head")." : "; | ||
| $headError = ErrorReporter::getResponseMessageType() === 0 ? |
There was a problem hiding this comment.
| CALL prnInsCountry('BAHAMAS'); | ||
| CALL prnInsCountry('BAHRAIN'); | ||
| CALL prnInsCountry('BANGLADESH'); | ||
| CALL prnInsCountry('BARBADOS'); |
There was a problem hiding this comment.
Issue found: syntax error at or near "CALL"
| SET chStatus=@Status; | ||
| END IF; | ||
|
|
||
| IF thDescription='' OR thDescription IS NULL |
There was a problem hiding this comment.
Issue found: syntax error at or near "IF"
| header("Access-Control-Allow-Methods: GET,HEAD,OPTIONS,POST,PUT"); | ||
| header("access-control-allow-methods: GET,HEAD,OPTIONS,POST,PUT"); | ||
| header("Access-Control-Allow-Headers: Or_+_igin, X-Requested-With, Content-Type, Accept, Authorization,Access-Control-Allow-Origin,access-control-allow-headers"); | ||
| header("access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization,Access-Control-Allow-Origin,access-control-allow-headers,access-control-allow-methods"); |
There was a problem hiding this comment.
Issue found: The use of function header() is discouraged
| if(in_array($_SERVER['REQUEST_METHOD'], array('POST', 'PUT', 'DELETE'))) { | ||
|
|
||
| //Make sure that the content type of the request has been set to application/json | ||
| $contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : ''; |
There was a problem hiding this comment.
| ELSE | ||
| SET @A='Nill';/**SELECT 'Specified Currency Name not be found';**/ | ||
| END IF; | ||
| END$$ |
There was a problem hiding this comment.
Issue found: syntax error at or near "END$$"
| "Class:FileHandler->persistFile; Empty status returned ", | ||
| "Unable to register file.<br/>Please try again Later" | ||
| ); | ||
| ErrorReporter::addNode($errorNode); |
There was a problem hiding this comment.
| CALL prnInsCountry('AUSTRALIA'); | ||
| CALL prnInsCountry('AUSTRIA'); | ||
| CALL prnInsCountry('AZERBAIJAN'); | ||
| CALL prnInsCountry('BAHAMAS'); |
There was a problem hiding this comment.
Issue found: syntax error at or near "CALL"
| SET vhName=@Name; | ||
| END IF; | ||
|
|
||
| IF chStatus='' OR chStatus IS NULL |
There was a problem hiding this comment.
Issue found: syntax error at or near "IF"
| dLastUpdate datetime not null, | ||
| cStatus char(1) not null | ||
| ); | ||
| alter table `broomy_db`.`FileType` auto_increment = 1; |
There was a problem hiding this comment.
Issue found: syntax error at or near "`"
| CALL prnInsCountry('CENTRAL AFRICAN'); | ||
| CALL prnInsCountry('REPUBLIC'); | ||
| CALL prnInsCountry('CHAD'); | ||
| CALL prnInsCountry('CHILE'); |
There was a problem hiding this comment.
Issue found: syntax error at or near "CALL"
| return $this->id; | ||
| } | ||
|
|
||
| public function setId($id) |
There was a problem hiding this comment.
| if (DatabaseManager::mysql_query($query)) { | ||
| $result = DatabaseManager::mysql_query($querySelectHolder); | ||
| if ($result) { | ||
| $num_results = DatabaseManager::mysql_num_rows($result); |
There was a problem hiding this comment.
| "Customer Object already exist: will not create new user ", | ||
| "Internal error occured. Please try again later." | ||
| ); | ||
| ErrorReporter::addNode($errorNode); |
There was a problem hiding this comment.
| return $this->id; | ||
| } | ||
|
|
||
| public function setId($id) |
There was a problem hiding this comment.
| { | ||
| if ($this->nextNode) { | ||
| return $this->nextNode; | ||
| } else { |
There was a problem hiding this comment.
| @@ -0,0 +1,88 @@ | |||
| USE broomy_db; | |||
|
|
|||
| DROP TABLE IF EXISTS `broomy_db`.`FileType`; | |||
There was a problem hiding this comment.
Issue found: syntax error at or near "`"
| $this->decoded['dateofbirth'] | ||
| ); | ||
| } elseif (strcasecmp($_SERVER['REQUEST_METHOD'], 'GET') | ||
| === 0 && sizeof($this->params) === $this->index_entity+2) { |
There was a problem hiding this comment.
| public function persistFile($sessionId, $fileGroupId, $fileType, $oldName, $fileDirPath, $extension, $size) | ||
| { | ||
| $error = ""; | ||
| $response = ""; |
There was a problem hiding this comment.
Issue found: Avoid unused local variables such as '$response'.
| USE broomy_db; | ||
|
|
||
| DROP TABLE IF EXISTS `broomy_db`.`CustomerSession`; | ||
| CREATE TABLE `broomy_db`.`CustomerSession` |
There was a problem hiding this comment.
Issue found: syntax error at or near "`"
| $row=""; | ||
| $response=""; | ||
| $error=""; | ||
| $result = DatabaseManager::mysql_query($query); |
There was a problem hiding this comment.
| SET CountryCode=CONCAT('0',CAST(COUNTER AS CHAR(3))); | ||
| WHEN COUNTER>99 and COUNTER<=999 THEN | ||
| SET CountryCode=CAST(COUNTER AS CHAR(3)); | ||
| END CASE; |
There was a problem hiding this comment.
Issue found: syntax error at or near "CASE"
| } elseif (strcasecmp($_SERVER['REQUEST_METHOD'], 'GET') | ||
| === 0 && sizeof($this->params) === $this->index_entity+2) { | ||
| //retrieve customer information by id | ||
| $customerId = $this->params[sizeof($this->params)-1]; |
There was a problem hiding this comment.
25b8cb9 to
cf72b75
Compare
Description
Created the following REST endpoints
Fixes #8 #9 #21
How Has This Been Tested?
Postman-Rest Client
Checklist: