Showing 3,235 of 4,504 total issues
Method userDeleted
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function userDeleted($uid, $shareType) {
$qb = $this->dbConn->getQueryBuilder();
$qb->delete('share');
Method getSharedWith
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSharedWith($userId, $shareType, $node = null, $limit = 50, $offset = 0) {
$provider = $this->factory->getProviderForType($shareType);
$shares = $provider->getSharedWith($userId, $shareType, $node, $limit, $offset);
Method __construct
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(ICheck $list) {
$this->list = $list;
$this->blackListedClassNames = [];
foreach ($list->getClasses() as $class => $blackListInfo) {
Method parseHttpRangeHeader
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function parseHttpRangeHeader($rangeHeaderPos, $fileSize) {
$rArray=\explode(',', $rangeHeaderPos);
$minOffset = 0;
$ind = 0;
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute($jobList, ILogger $logger = null) {
$jobList->setLastRun($this);
try {
//storing job start time
$jobStartTime = \time();
Method setUserValue
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUserValue($userId, $appName, $key, $value, $preCondition = null) {
if (!\is_int($value) && !\is_float($value) && !\is_string($value)) {
throw new \UnexpectedValueException('Only integers, floats and strings are allowed as value');
}
Function manageMountPointError
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
manageMountPointError: function (name) {
this.getMountStatus($.proxy(function (allMountStatus) {
if (allMountStatus.hasOwnProperty(name) && allMountStatus[name].status > 0 && allMountStatus[name].status < 7) {
var mountData = allMountStatus[name];
if (mountData.type === "system") {
- 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 translate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
translate: function(app, text, vars, count, options) {
var defaultOptions = {
escape: true
},
allOptions = options || {};
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function execute(InputInterface $input, OutputInterface $output): int {
$remoteStorages = $this->getRemoteStorages();
$output->writeln(\count($remoteStorages) . " remote storage(s) need(s) to be checked");
- 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 stats
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function stats() {
$userCount = 0;
if ($this->isAdmin) {
$countByBackend = $this->userManager->countUsers();
- 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 setMailAddress
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function setMailAddress($id, $mailAddress) {
$userId = $this->userSession->getUser()->getUID();
$user = $this->userManager->get($id);
if ($userId !== $id
- 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 fopen
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function fopen($path, $mode) {
if ($source = $this->getSourcePath($path)) {
switch ($mode) {
case 'r+':
case 'rb+':
- 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 parseRetentionObligation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function parseRetentionObligation() {
$splitValues = \explode(',', $this->retentionObligation);
if (!isset($splitValues[0])) {
$minValue = self::DEFAULT_RETENTION_OBLIGATION;
} else {
- 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 prepare
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function prepare(INotification $notification, $languageCode) {
if ($notification->getApp() !== 'files_sharing') {
// Not my app => throw
throw new \InvalidArgumentException();
}
- 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 commentEvent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function commentEvent(CommentsEvent $event) {
if ($event->getComment()->getObjectType() !== 'files'
|| !\in_array($event->getEvent(), [CommentsEvent::EVENT_ADD])
|| !$this->appManager->isInstalled('activity')) {
// Comment not for file, not adding a comment or no activity-app enabled (save the energy)
- 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 schedule
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function schedule(ITip\Message $iTipMessage) {
// Not sending any emails if OC-CalDav-Import header is set
if ($this->request->getHeader('OC-CalDav-Import') !== null) {
return;
}
- 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 processNotification
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function processNotification(
$notificationType,
$resourceType,
$providerId,
$notification
- 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 buildDateFromContact
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function buildDateFromContact($cardData, $dateField, $summarySymbol) {
if (empty($cardData)) {
return null;
}
try {
- 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 ocmDiscover
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function ocmDiscover($remote) {
// Check if something is in the cache
if ($cacheData = $this->cache->get('OCM' . $remote)) {
return \json_decode($cacheData, true);
}
- 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 convertToSabreException
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function convertToSabreException(\Exception $e) {
if ($e instanceof FileContentNotAllowedException) {
// the file content is not permitted
throw new DAVForbiddenException($e->getMessage(), $e->getRetry(), $e);
}
- 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"