Goracash/goracash-api-php-client

View on GitHub
src/Logger/Primary.php

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 9 of 9 total issues

Function reverseJsonInContext has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

protected function reverseJsonInContext(array &$context)
{
if (!$context) {
return;
}
Severity: Minor
Found in src/Logger/Primary.php - About 55 mins to fix

Function export has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

protected function export($value)
{
if (is_string($value)) {
if ($this->allowNewLines) {
return $value;
Severity: Minor
Found in src/Logger/Primary.php - About 45 mins to fix

Avoid too many return statements within this method.
Open

return @json_encode($value, $options);
Severity: Major
Found in src/Logger/Primary.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

return str_replace('\\/', '/', @json_encode($value));
Severity: Major
Found in src/Logger/Primary.php - About 30 mins to fix

Function interpolate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

protected function interpolate(array $variables = array())
{
$template = $this->logFormat;
 
if (!isset($variables['context'])) {
Severity: Minor
Found in src/Logger/Primary.php - About 25 mins to fix

Remove error control operator '@' on line 371.
Open

protected function export($value)
{
if (is_string($value)) {
if ($this->allowNewLines) {
return $value;
Severity: Minor
Found in src/Logger/Primary.php by phpmd

Missing class import via use statement (line '272', column '35').
Open

'datetime' => new \DateTime(),
Severity: Minor
Found in src/Logger/Primary.php by phpmd

Remove error control operator '@' on line 368.
Open

protected function export($value)
{
if (is_string($value)) {
if ($this->allowNewLines) {
return $value;
Severity: Minor
Found in src/Logger/Primary.php by phpmd

Remove error control operator '@' on line 328.
Open

protected function reverseJsonInContext(array &$context)
{
if (!$context) {
return;
}
Severity: Minor
Found in src/Logger/Primary.php by phpmd

There are no issues that match your filters.

Category
Status