Showing 3,235 of 4,504 total issues
Function loadCategory
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadCategory: function(categoryId) {
var self = this;
if (OC.Settings.Apps.State.currentCategory === categoryId) {
return;
}
Function loadPreview
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadPreview: function(path, mime, etag, $iconDiv, $container, isImage) {
var maxImageWidth = $container.parent().width() + 50; // 50px for negative margins
var maxImageHeight = maxImageWidth / (16/9);
var smallPreviewSize = 75;
Method validate
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validate(IStorageConfig $storage) {
$mountPoint = $storage->getMountPoint();
if ($mountPoint === '' || $mountPoint === '/') {
return new DataResponse(
[
Method writeBack
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeBack($tmpFile) {
if (isset(self::$tempFiles[$tmpFile])) {
$path = self::$tempFiles[$tmpFile];
$parentFolder = $this->getDriveFile(\dirname($path));
if ($parentFolder) {
Method fopen
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fopen($path, $mode) {
$this->init();
$path = $this->cleanPath($path);
switch ($mode) {
case 'r':
Method createDBUser
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createDBUser($connection) {
$name = $this->dbUser;
$password = $this->dbPassword;
$query = 'SELECT * FROM all_users WHERE USERNAME = :un';
$stmt = \oci_parse($connection, $query);
Method validateExpirationDate
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validateExpirationDate(\OCP\Share\IShare $share, $skipPastDateValidation = false) {
$expirationDate = $share->getExpirationDate();
if ($expirationDate !== null) {
// Set the expiration date to just the date at "zero" time in the day
Method loadCommands
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadCommands(InputInterface $input, OutputInterface $output) {
// $application is required to be defined in the register_command scripts
$application = $this->application;
$inputDefinition = $application->getDefinition();
$inputDefinition->addOption(
Function reloadCallback
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
reloadCallback: function(status, result) {
delete this._reloadCall;
this.hideMask();
if (status === 401) {
File oc.js
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Seleccionatz un fichièr.",
"File is too big" : "Fichièr tròp voluminós",
Method getSpecialParameterList
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSpecialParameterList($app, $text) {
if ($app === self::FILES_SHARING_APP) {
switch ($text) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED:
case self::SUBJECT_REMOTE_SHARE_UNSHARED:
Method execute
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$sourceUserObject = $this->userManager->get($input->getArgument('source-user'));
$destinationUserObject = $this->userManager->get($input->getArgument('destination-user'));
if ($sourceUserObject === null) {
$output->writeln("<error>Unknown source user $this->sourceUser</error>");
Method updateStorage
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateStorage(IStorageConfig $updatedStorage) {
$id = $updatedStorage->getId();
$existingMount = $this->dbConfig->getMountById($id);
Method changeSchema
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function changeSchema(Schema $schema, array $options) {
$prefix = $options['tablePrefix'];
$table = $schema->createTable("{$prefix}persistent_locks");
$table->addColumn('id', Type::BIGINT, [
'autoincrement' => true,
Function listen
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
listen:function(type,callback){
if(callback && callback.call){
if(type){
if(this.useFallBack){
- 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 restore
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function restore($filename, $targetLocation = null) {
$user = User::getUser();
$view = new View('/' . $user);
$nameOfFile = \basename($filename);
$dirOfFile = \dirname($filename);
- 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 removeFromGroup
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function removeFromGroup($parameters) {
// Check if user is logged in
$loggedInUser = $this->userSession->getUser();
if ($loggedInUser === null) {
return new Result(null, API::RESPOND_UNAUTHORISED);
- 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 store
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function store($filename) {
if (\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
// if the file gets streamed we need to remove the .part extension
// to get the right target
$ext = \pathinfo($filename, PATHINFO_EXTENSION);
- 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 search
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function search($search, $limit = null, $offset = null, $scope = null, $alwaysReturnAllMatches = false) {
$groups = [];
if ($alwaysReturnAllMatches || $this->userSearch->isSearchable($search)) {
foreach ($this->backends as $backend) {
if (!$backend->isVisibleForScope($scope)) {
- 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 __construct
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($params) {
$this->statCache = new ArrayCache();
$this->httpClientService = \OC::$server->getHTTPClientService();
$this->webDavClientService = \OC::$server->getWebDavClientService();
if (isset($params['host'], $params['user'], $params['password'])) {
- 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"