Showing 3,235 of 4,503 total issues
Function loadIndex
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
private function loadIndex($table, $xml) {
$name = null;
$fields = [];
foreach ($xml->children() as $child) {
/**
- 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 filepicker
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filepicker:function(title, callback, multiselect, mimetypeFilter, modal) {
var self = this;
// avoid opening the picker twice
if (this.filepicker.loading) {
return;
File sl.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
OC.L10N.register(
"settings",
{
"No user supplied" : "Ni navedenega uporabnika",
"Authentication error" : "Napaka overjanja",
Method getCalendarsForUser
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getCalendarsForUser($principalUri) {
$principalUriOriginal = $principalUri;
$principalUri = $this->convertPrincipal($principalUri, true);
$fields = \array_values($this->propertyMap);
$fields[] = 'id';
Method initPaths
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function initPaths() {
if (\defined('PHPUNIT_CONFIG_DIR')) {
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
} elseif (\defined('PHPUNIT_RUN') and PHPUNIT_RUN and \is_dir(OC::$SERVERROOT . '/tests/config/')) {
self::$configDir = OC::$SERVERROOT . '/tests/config/';
Method execute
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$appId = $input->getArgument('app-id');
$checkList = new EmptyCheck();
foreach ($input->getOption('checker') as $checker) {
Method buildCoreRoles
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function buildCoreRoles(AddRolesEvent $event) {
$event->addRole(
[
'id' => 'core.viewer',
'displayName' => $this->l10n->t('Download / View'),
File Local.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Bart Visscher <bartv@thisnet.nl>
* @author Boris Rybalkin <ribalkin@gmail.com>
* @author Brice Maron <brice@bmaron.net>
Storage
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Storage {
public const DEFAULTENABLED=true;
public const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota
public const VERSIONS_ROOT = 'files_versions/';
File sv.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
OC.L10N.register(
"settings",
{
"No user supplied" : "Ingen användare angiven",
"Authentication error" : "Fel vid autentisering",
Function checkSetup
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
checkSetup: function() {
var deferred = $.Deferred();
var afterCall = function(data, statusText, xhr) {
var messages = [];
if (xhr.status === 200 && data) {
Function fail
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fail: function(e, data) {
var upload = self.getUpload(data);
if (upload && upload.data && upload.data.stalled) {
self.log('retry', e, upload);
// jQuery Widget Factory uses "namespace-widgetname" since version 1.10.0:
Method getLocks
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getLocks($uri, $returnChildLocks) {
try {
$node = $this->tree->getNodeForPath($uri);
if ($node instanceof SharedFile || $node instanceof SharedFolder) {
Method unshareFromSelf
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = false) {
$originType = ($originIsSource) ? 'source' : 'target';
$uid = \OCP\User::getUser();
if ($itemType === 'file' || $itemType === 'folder') {
Function singleSelect
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.singleSelect = function () {
return this.each(function (i, select) {
var input = $('<input/>'),
placement = $(select).attr('data-tooltip-placement'),
inputTooltip = $(select).attr('data-inputtitle');
Method scanFiles
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function scanFiles($user, $path, $verbose, OutputInterface $output, $backgroundScan = false, $shouldRepair = false) {
$connection = $this->reconnectToDatabase($output);
$scanner = new \OC\Files\Utils\Scanner($user, $connection, \OC::$server->getLogger());
if ($shouldRepair) {
$scanner->listen('\OC\Files\Utils\Scanner', 'beforeScanStorage', function ($storage) use ($output, $connection) {
Method setupDatabase
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setupDatabase($username) {
$e_host = \addslashes($this->dbHost);
$e_dbname = \addslashes($this->dbName);
//check if the database user has admin right
if ($this->dbConnectionString !== null) {
File FilesPlugin.php
has 303 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>
File TransferOwnership.php
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Carla Schroder <carla@owncloud.com>
* @author Joas Schilling <coding@schilljs.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
File Encryption.php
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Björn Schießle <bjoern@schiessle.org>
* @author jknockaert <jasper@knockaert.nl>
* @author Lukas Reschke <lukas@statuscode.ch>