Showing 9 of 9 total issues
Function injectDependecy
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
public function injectDependecy(array $dependencies)
{
if (!empty($dependencies)) {
foreach ($dependencies as $name => $object) {
if (is_array($object) && !empty($object)) {
- 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
SkeletonController
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class SkeletonController implements SkeletonControllerInterface
{
/**
* @var ContainerInterface
*/
Method injectDependecy
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function injectDependecy(array $dependencies)
{
if (!empty($dependencies)) {
foreach ($dependencies as $name => $object) {
if (is_array($object) && !empty($object)) {
Function getCacheType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getCacheType($cacheType = '', $useArrayCacheOnDevelopment = true)
{
if ($useArrayCacheOnDevelopment && $this->isDevelopment) {
$cache = new \Doctrine\Common\Cache\ArrayCache();
- 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 validateCallback
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validateCallback($callback, $name)
{
if (!$callback && !(is_string($callback) && emtpy($callback))) {
throw new SkeletonException("Error: Callback need to be declared in route {$name}");
}
Method __invoke
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke(ContainerInterface $ci)
{
$settings = $ci->get('settings');
$this->isDevelopment = $settings['environment']['isDevelopment'];
$this->configOptions = $settings['doctrine']['config'];
Function validateCallback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function validateCallback($callback, $name)
{
if (!$callback && !(is_string($callback) && emtpy($callback))) {
throw new SkeletonException("Error: Callback need to be declared in route {$name}");
}
- 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 validateRoute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function validateRoute($name, $route)
{
$arr_route = [];
if (!array_key_exists('method', $route)) {
- 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 getRepositoryEntity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getRepositoryEntity($strEntity = null)
{
if (empty($strEntity)) {
if (!$this->strEntity) {
$this->setRepositoryFromServiceName();
- 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"