Showing 19 of 22 total issues
Function modifyResponse
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function modifyResponse($response)
{
if (is_array($response)) {
// Array of DTOs
foreach ($response as $key => $val) {
- 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
FrameworkConfiguration
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class FrameworkConfiguration
{
/**
* @var LoggerInterface
*/
Method executeQuery
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function executeQuery($queryString, array $variables)
{
try {
$this->loadSchema();
Function executeQuery
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function executeQuery($queryString, array $variables)
{
try {
$this->loadSchema();
- 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 extractNamespace
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function extractNamespace(array $tokens)
{
$extractedNamespace = "";
$inNamespace = false;
- 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 getPersistentCacheStatus
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function getPersistentCacheStatus($forceStatus, $cacheName)
{
if ($forceStatus === true) {
if ($this->cacheAdapter === null) {
throw new NoCacheAdapterConfiguredException($cacheName);
- 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 createInstanceFromDefinition
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function createInstanceFromDefinition($definition, $values)
{
if (!array_key_exists('fqn', $definition)) {
throw new FQNDefinitionMissingException();
}
- 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 modifyResponse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function modifyResponse($response)
{
if (is_array($response)) {
// Array of DTOs
foreach ($response as $key => $val) {
Function executePostRequest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function executePostRequest(ServerRequestInterface $request)
{
$parsedBody = json_decode($request->getBody()->getContents(), true);
if ($parsedBody === null || !array_key_exists('query', $parsedBody)) {
- 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 modifyRequest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function modifyRequest($request)
{
if (is_array($request)) {
if (array_key_exists($this->idFieldName, $request)) {
$relayIdentifier = new RelayGlobalIdentifier();
- 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 getPotentialControllerClasses
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getPotentialControllerClasses()
{
if ($this->controllers === null) {
$lister = new DirectoryLister($this->controllersDirectory);
- 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 getControllerForTypeExpectingGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getControllerForTypeExpectingGroup($typeName, $expectedGroup)
{
foreach ($this->getGroupedControllers() as $groupName => $controllers) {
/** @var ClassInfoReaderResult[] $controllers */
$controllerMatcher = new ControllerMatcher($controllers);
- 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 executeGetRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function executeGetRequest(ServerRequestInterface $request)
{
$queryParams = $request->getQueryParams();
if (!array_key_exists('query', $queryParams)) {
- 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
Avoid too many return
statements within this method. Open
return new ExecutorResult(json_encode($exceptionPayload), $ex);
Avoid too many return
statements within this method. Open
return new ExecutorResult(json_encode([
'internalException' => [
'message' => $ex->getMessage(),
'trace' => $ex->getTrace(),
]
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return new ExecutorResult(json_encode($result), $handledException);
Function getDepthPropertiesFromDefinition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getDepthPropertiesFromDefinition($definition)
{
$depthProperties = [];
if (array_key_exists('fields', $definition)) {
- 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 getDiscoveredType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getDiscoveredType($typeName)
{
$similarDiscoveredType = array_filter($this->discoveredTypes, function (DiscoveredType $discoveredType) use ($typeName) {
return $discoveredType->getTypeName() === $typeName;
});
- 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"