File Manager.php
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Björn Schießle <bjoern@schiessle.org>
* @author Joas Schilling <coding@schilljs.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
Manager
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Manager implements IManager {
/** @var IRequest */
protected $request;
/** @var IUserSession */
Function getNotificationTypes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getNotificationTypes($languageCode) {
$filesNotificationTypes = [];
$sharingNotificationTypes = [];
$notificationTypes = [];
- 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 publishActivity
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority) {
Function publish
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function publish(IEvent $event) {
if (!$event->getApp()) {
throw new \BadMethodCallException('App not set', 10);
}
if (!$event->getType()) {
- 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 getQueryForFilter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryForFilter($filter) {
if (!$this->isFilterValid($filter)) {
return [null, 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 translate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {