Method generatePage
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generatePage(Page $P)
{
$requesturi = $this->helper->getCleanRequestTarget();
$aP = [
Function generatePage
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function generatePage(Page $P)
{
$requesturi = $this->helper->getCleanRequestTarget();
$aP = [
- 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
File HCSF.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace HaaseIT\HCSF;
use Zend\ServiceManager\ServiceManager;
Method init
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
$this->serviceManager = new ServiceManager();
if (!CLI) {
Function setupSession
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function setupSession()
{
if (
(
$this->config->getCore('enable_module_customer')
- 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 setupSession
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setupSession()
{
if (
(
$this->config->getCore('enable_module_customer')
Method setupTwig
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setupTwig()
{
$this->serviceManager->setFactory('twig', function (ServiceManager $serviceManager) {
$loader = new \Twig_Loader_Filesystem([PATH_BASEDIR.'customization/views', HCSF_BASEDIR.'src/views/']);
Function init
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
$this->serviceManager = new ServiceManager();
if (!CLI) {
- 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 $router->getPage();
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $this->setupHardcodedTextcats();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return new \HaaseIT\HCSF\Shop\Items($serviceManager);