Showing 19 of 86 total issues
Method createRequestBody
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequestBody(NovaCreateOffersParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
Method createPartner
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createPartner(DOMElement $partnerNode, XmlDocument $xml): NovaPartner
{
$partner = new NovaPartner();
$partner->tkId = $xml->getAttributeValue('@tkid', $partnerNode);
Method createRequestBody
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequestBody(NovaCreateServicesParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
Function appendNovaMessages
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function appendNovaMessages(XmlDocument $xml, array $namespace, array $messages): array
{
$ns1 = $namespace[0];
$ns2 = $namespace[1];
- Read upRead up
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
Method getSoapErrors
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSoapErrors(XmlDocument $xml, NovaApiErrorList $errors): NovaApiErrorList
{
$xml = $xml->withoutNamespaces();
$xmlContent = $xml->getXml();
Method createResult
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createResult(XmlDocument $xml): NovaCreateOffersResult
{
$result = new NovaCreateOffersResult();
$xml = $xml->withoutNamespaces();
Method appendNovaMessages
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function appendNovaMessages(XmlDocument $xml, array $namespace, array $messages): array
{
$ns1 = $namespace[0];
$ns2 = $namespace[1];
Method createRequestBody
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequestBody(NovaSearchServicesParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
Method createRequestBody
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequestBody(NovaSearchPartnerParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
Function createPartner
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function createPartner(DOMElement $partnerNode, XmlDocument $xml): NovaPartner
{
$partner = new NovaPartner();
$partner->tkId = $xml->getAttributeValue('@tkid', $partnerNode);
- Read upRead up
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
Method login
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function login(string $clientId, string $clientSecret): string
{
$options = [
'body' => http_build_query(
[
Method createRequestBody
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequestBody(NovaPurchaseServicesParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
Method appendMethodNamespaces
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function appendMethodNamespaces(DOMElement $method)
{
$method->setAttribute('xmlns:ns22', 'http://nova.voev.ch/services/internal/leistungnotification');
$method->setAttribute('xmlns:ns21', $this->novaSoapAction->getServiceNamespace('vertrieb'));
$method->setAttribute('xmlns:nova-leistungnotiz', $this->novaSoapAction->getServiceNamespace('leistungnotiz'));
Method appendMethodNamespaces
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function appendMethodNamespaces(DOMElement $method)
{
$method->setAttribute('xmlns:ns20', 'http://nova.voev.ch/services/internal/leistungnotification');
$method->setAttribute('xmlns:ns19', $this->getServiceNamespace('inkasso'));
$method->setAttribute('xmlns:ns18', $this->getServiceNamespace('vertrieb'));
Function createRequestBody
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function createRequestBody(NovaSearchServicesParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
- Read upRead up
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
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
NovaSearchPartnerMethod $novaSearchPartnerMethod,
CheckSwissPassValidityMethod $checkSwissPassValidityMethod,
NovaCreateOffersMethod $novaCreateOffersMethod,
NovaCreateServicesMethod $novaCreateServicesMethod,
NovaPurchaseServicesMethod $novaPurchaseServicesMethod,
Function createRequestBody
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function createRequestBody(NovaCreateOffersParameter $parameter): string
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
- Read upRead up
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
Function withoutNamespaces
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function withoutNamespaces(): self
{
$dom = new DOMDocument();
$dom->formatOutput = true;
- Read upRead up
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
Function getExceptionMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getExceptionMessage(Exception $exception): string
{
$errors = new NovaApiErrorList();
if ($exception instanceof ClientException) {
- Read upRead up
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"