Showing 3,235 of 4,504 total issues
Manager
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Manager extends PublicEmitter implements IUserManager {
use EventEmitterTrait;
/** @var UserInterface[] $backends */
private $backends = [];
Function filter
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filter: function(query) {
// FIXME: the caller doesn't properly set the "this" context
var self = OC.Settings.Apps;
self._filterQuery = query;
Method create
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create(\OCP\Share\IShare $share) {
$this->validate($share);
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share');
Method getStorageInfo
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getStorageInfo($path, $rootInfo = null) {
// return storage info without adding mount points
$includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false);
if (!$rootInfo) {
Method saveColumn
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function saveColumn($column, $xml) {
$xml->addChild('name', $column->getName());
switch ($column->getType()) {
case 'SmallInt':
case 'Integer':
Method auth
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function auth(IRequest $request) {
if (!isset($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'])) {
return null;
}
if ($this->session->exists('app_password')) {
Method configure
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function configure() {
parent::configure();
$this
->setName('user:setting')
->setDescription('Read and modify user settings.')
File Notifications.php
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Björn Schießle <bjoern@schiessle.org>
* @author Joas Schilling <coding@schilljs.com>
* @author Lukas Reschke <lukas@statuscode.ch>
Function RollingQueue
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var RollingQueue = function (functionList, queueWindow, callback) {
this.queueWindow = queueWindow || 1;
this.functionList = functionList;
this.callback = callback;
this.counter = 0;
Method translateLong
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function translateLong($text, IL10N $l, array $params) {
switch ($text) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED:
if (\sizeof($params) > 1) {
// New activity ownCloud 8.2+
Method updateShareState
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function updateShareState($id, $state) {
$eventName = '';
if ($state === Share::STATE_ACCEPTED) {
$eventName = 'accept';
} elseif ($state === Share::STATE_REJECTED) {
Method formatItems
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function formatItems($items, $format, $parameters = null) {
if ($format == self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call
$item = \array_shift($items);
return [
Method restoreVersionsFromTrashbin
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function restoreVersionsFromTrashbin(View $view, $filename, $targetLocation) {
if (\OCP\App::isEnabled('files_versions')) {
$user = User::getUser();
$rootView = new View('/');
Method createCalendarSubscriptionsTable
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createCalendarSubscriptionsTable(Schema $schema) {
if (!$schema->hasTable("{$this->prefix}calendarsubscriptions")) {
$table = $schema->createTable("{$this->prefix}calendarsubscriptions");
$table->addColumn('id', 'integer', [
'autoincrement' => true,
Method updateTag
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function updateTag($tagId, $tagName, $userVisible, $userAssignable, $userEditable = null) {
$userVisible = (int)$userVisible;
$userAssignable = (int)$userAssignable;
/**
Method transferShare
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function transferShare(IShare $share, $oldOwner, $newOwner, $finalTarget, $isChild = null) {
if ($this->userManager->get($oldOwner) === null) {
throw new TransferSharesException("The current owner of the share $oldOwner doesn't exist");
}
if ($this->userManager->get($newOwner) === null) {
Method afterException
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function afterException($controller, $methodName, \Exception $exception) {
$headers = [];
if ($controller instanceof OCSController) {
if ($this->request->getHeader('OC-RequestAppPassword') === 'true'
&& ($exception instanceof NotLoggedInException || $exception instanceof LoginException)) {
Method copyTable
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function copyTable(Connection $fromDB, Connection $toDB, Table $table, InputInterface $input, OutputInterface $output) {
$tableName = $table->getName();
$chunkSize = $input->getOption('chunk-size');
$progress = new ProgressBar($output);
Function renderApp
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
renderApp: function(app, template, selector, firstExperimental) {
if (!template) {
var source = $("#app-template").html();
template = Handlebars.compile(source);
}
- 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 markFileAsShared
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
markFileAsShared: function($tr, hasShares, hasLink) {
var action = $tr.find('.fileactions .action[data-action="Share"]');
var type = $tr.data('type');
var icon = action.find('.icon');
var message;
- 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"