Showing 758 of 758 total issues
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->module === null) {
throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
}
Function all
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function all(bool $sync_available = false, bool $include_disabled = true): Collection
{
$tasks_schedules = DB::table('maj_admintasks')
->select()
->get()
- 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 handle
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/ajax';
if ($this->module === null) {
Method convert
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convert(GeoAnalysisResult $result): MapAdapterResult
{
$result = $result->copy();
$features = [];
Method handle
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if ($this->module === null) {
Avoid using short method names like TaskSchedule::id(). The configured minimum method name length is 3. Open
public function id(): int
{
return $this->id;
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like MapDefinitionInterface::id(). The configured minimum method name length is 3. Open
public function id(): string;
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like SimpleFilesystemMap::id(). The configured minimum method name length is 3. Open
public function id(): string
{
return $this->id;
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like AbstractGeoAnalysisView::id(). The configured minimum method name length is 3. Open
public function id(): int
{
return $this->id;
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like GeoAnalysisMapAdapter::id(). The configured minimum method name length is 3. Open
public function id(): int
{
return $this->id;
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Method targetId
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function targetId(string $source, string $source_format, string $target_format): ?string
{
// Extract parts for the WHERE clause
$source_format = str_replace(['{', '}'], ['{#', '#}'], $source_format);
$source_parts = preg_split('/[{}]/i', $source_format);
Method visits
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function visits(WelcomeBlockModule $module, int $block_id, string $period): ?int
{
$settings = $module->matomoSettings($block_id);
if (
Method upgrade
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade(): void
{
if (!DB::schema()->hasTable('maj_geodispersion')) {
return;
}
Method handle
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->module === null) {
FlashMessages::addMessage(
I18N::translate('The attached module could not be found.'),
Method all
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function all(bool $include_disabled = false): Collection
{
return Registry::cache()->array()->remember('all-hooks', function () use ($include_disabled): Collection {
$hooks_info = DB::table('maj_hook_order')
->get()
Method handle
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/ajax';
if ($this->module === null) {
Method handle
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if ($this->module === null) {
Function results
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function results(Tree $tree, int $depth): GeoAnalysisResults
{
$results = new GeoAnalysisResults();
$unique_ancestors = $this->records_service
- 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 handle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/ajax';
if ($this->module === null) {
- 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 loadRoutes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadRoutes($router): void
{
$router->attach('', '', static function (Map $router): void {
$router->attach('', '/module-maj/certificates', static function (Map $router): void {