Showing 3,235 of 4,503 total issues
Method install
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function install($options) {
$l = $this->l10n;
$error = [];
$dbType = $options['dbtype'];
File zh_TW.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"settings",
{
"Wrong current password" : "當前密碼錯誤",
"The new password cannot be the same as the previous one" : "新密碼不能與上一個密碼重複.",
File Checker.php
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Roeland Jago Douma <rullzer@owncloud.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
Function copyBetweenStorage
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
// for versions we have nothing to do, because versions should always use the
// key from the original file. Just create a 1:1 copy and done
if ($this->isVersion($targetInternalPath) ||
$this->isVersion($sourceInternalPath)) {
- 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 checkReshare
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private static function checkReshare($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $itemSourceName, $expirationDate) {
$backend = self::getBackend($itemType);
$l = \OC::$server->getL10N('lib');
$result = [];
- 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 analyse
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function analyse($appId) {
$appPath = $this->appManager->getAppPath($appId);
if ($appPath === false) {
throw new \RuntimeException("No app with given id <$appId> known.");
}
- 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 parse
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function parse($file) {
if (!\is_file($file)) {
throw new AppNotFoundException(
\sprintf('%s does not exist', $file)
);
- 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
Node
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class Node implements \OCP\Files\Node {
/**
* @var \OC\Files\View $view
*/
protected $view;
Method processNotification
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processNotification(
$notificationType,
$resourceType,
$providerId,
$notification
Method setPermissions
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
$l = \OC::$server->getL10N('lib');
$connection = \OC::$server->getDatabaseConnection();
$intArrayToLiteralArray = function ($intArray, $eb) {
File gl.js
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"settings",
{
"Wrong current password" : "O contrasinal actual é incorrecto",
"The new password cannot be the same as the previous one" : "O novo contrasinal non pode ser o mesmo que o anterior",
File he.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"settings",
{
"Wrong current password" : "סיסמא נוכחית שגויה",
"The new password cannot be the same as the previous one" : "הסיסמא החדשה אינה יכולה להיות זהה לסיסמא הקודמת",
Function restoreVersionsFromTrashbin
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private static function restoreVersionsFromTrashbin(View $view, $filename, $targetLocation) {
if (\OCP\App::isEnabled('files_versions')) {
$user = User::getUser();
$rootView = new View('/');
- 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 editUser
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function editUser($parameters) {
/** @var string $targetUserId */
$targetUserId = $parameters['userid'];
// Check if user is logged in
- 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 init
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function init() {
// calculate the root directories
OC::$SERVERROOT = \str_replace("\\", '/', \substr(__DIR__, 0, -4));
// register autoloader
- 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 process
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function process(bool $all = false, int $chunkSize = 1000, \Closure $progress = null): int {
$root = \OC::$server->getLazyRootFolder();
$count = 0;
$qb = $this->connection->getQueryBuilder();
- 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 loadApps
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function loadApps($types = null) {
if (\is_array($types) && !\array_diff($types, self::$loadedTypes)) {
return true;
}
if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
- 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 getShippedApps
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
protected static function getShippedApps() {
$shippedApps = [];
foreach (\OC::$APPSROOTS as $app_dir) {
if ($dir = \opendir($app_dir['path'])) {
$nodes = \scandir($app_dir['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 execute
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$username = $input->getArgument('user');
$emailLink = $input->getOption('send-email');
$displayLink = $input->getOption('output-link');
- 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
File de_CH.js
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"settings",
{
"Wrong current password" : "Das aktuelle Passwort ist falsch.",
"The new password cannot be the same as the previous one" : "Das neue Passwort kann nicht identisch zum alten Passwort sein.",