Showing 3,235 of 4,504 total issues
Method upgrade
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade() {
$this->emitRepairEvents();
$logLevel = $this->config->getSystemValue('loglevel', Util::WARN);
$this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]);
Method getAppsFromMarket
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAppsFromMarket(IOutput $output, $appList, $event) {
$failedApps = [];
foreach ($appList as $app) {
$output->info("Fetching app from market: $app");
try {
Method linkTo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function linkTo($app, $file, $args = []) {
$frontControllerActive = (\getenv('front_controller_active') === 'true');
$webRoot = $this->environmentHelper->getWebRoot();
if ($app != '') {
Method loadApp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function loadApp($app, $checkUpgrade = true) {
self::$loadedApps[] = $app;
$appPath = self::getAppPath($app);
if ($appPath === false) {
return;
Method installShippedApp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function installShippedApp($app) {
\OC::$server->getLogger()->info('Attempting to install shipped app: '.$app);
$info = OC_App::getAppInfo($app);
if ($info === null) {
Method get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get($uid, $evenMissing = false) {
// fix numeric uid that was cast by storing it in an array key
if (\is_numeric($uid)) {
$uid = (string)$uid;
}
Method getLocksByPath
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLocksByPath($storageId, $internalPath, $returnChildLocks) {
$query = $this->db->getQueryBuilder();
$internalPath = \rtrim($internalPath, '/');
/*
Method setPassword
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setPassword($password, $recoveryPassword = null) {
if (!$this->allowUserAccountUpdate) {
throw new NotPermittedActionException("Operation cannot be allowed as other apps are fetching extended attributes of this user.");
}
Method changeSchema
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function changeSchema(Schema $schema, array $options) {
$prefix = $options['tablePrefix'];
if (!$schema->hasTable("{$prefix}account_terms")) {
$table = $schema->createTable("{$prefix}account_terms");
Method execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$toBeSet = [];
if ($input->getOption('enable')) {
$toBeSet['log_type'] = 'owncloud';
Method execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
$key = $input->getArgument('key');
$value = $input->getArgument('value');
Method configure
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure() {
$this
->setName('user:add')
->setDescription('adds a user')
->addArgument(
Method handleRepairFeedback
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleRepairFeedback($event) {
if (!$event instanceof GenericEvent) {
return;
}
Function joinPaths
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
joinPaths: function () {
if (arguments.length < 1) {
return '';
}
var path = '';
- 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 exec
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function exec($folder, $license, $gitRoot = false) {
if (isset($this->licenseText[$license])) {
echo "Unknown license $license. Supported: agpl, gpl or ocl";
}
$license = $this->licenseText[$license];
- 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 getPanel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getPanel() {
// create htaccess test file
$util = new \OC_Util();
$util->createHtaccessTestFile($this->config);
- 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 resolveReshares
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected static function resolveReshares($source) {
if (isset($source['parent'])) {
$parent = $source['parent'];
while (isset($parent)) {
$query = \OCP\DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1);
- 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 getShareById
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getShareById($id, $recipient = null) {
$share = null;
$providerIds = \array_keys($this->shareManager->getProvidersCapabilities());
// First check if it is an internal share.
- 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 syncThemAll
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function syncThemAll(\Closure $callback) {
$trustedServers = $this->dbHandler->getAllServer();
foreach ($trustedServers as $trustedServer) {
$url = $trustedServer['url'];
$callback($url, 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 __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
IDBConnection $connection,
EventDispatcherInterface $eventDispatcher,
AddressHandler $addressHandler,
Notifications $notifications,
TokenHandler $tokenHandler,