src/CoreBundle/Controller/SessionController.php
The method about() has an NPath complexity of 492. The configured NPath complexity threshold is 200. Open
Open
public function about(
Request $request,
Session $session,
IllustrationRepository $illustrationRepo,
UserRepository $userRepo,
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
Avoid using undefined variables such as '$htmlHeadXtra' which will lead to PHP notices. Open
Open
$htmlHeadXtra[] = api_get_asset('readmore-js/readmore.js');
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The class SessionController has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13. Open
Open
class SessionController extends AbstractController
{
/**
* @Entity("session", expr="repository.find(sid)")
*/
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Avoid unused local variables such as '$sequenceResourceRepo'. Open
Open
$sequenceResourceRepo = $em->getRepository(SequenceResource::class);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$htmlHeadXtra'. Open
Open
$htmlHeadXtra[] = api_get_asset('readmore-js/readmore.js');
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[Route(path: '/{sid}/about', name: 'chamilo_core_session_about')]
- Exclude checks
You must use "/**" style comments for a class comment Open
Open
class SessionController extends AbstractController
- Exclude checks
Add a single space around assignment operators Open
Open
declare(strict_types=1);
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[Route('/sessions')]
- Exclude checks
You must use "/**" style comments for a function comment Open
Open
public function about(
- Exclude checks