Showing 4,504 of 4,504 total issues
File filelist.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014
*
* This file is licensed under the Affero General Public License version 3
* or later.
Function setupGroupsSelect
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupGroupsSelect: function($elements, extraOptions, options) {
var self = this;
options = options || {};
if ($elements.length > 0) {
// note: settings are saved through a "change" event registered
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,
Identical blocks of code found in 5 locations. Consider refactoring. Open
this._client.request(
operation,
options.pathIsUrl ? path : this._buildUrl(path),
headers
).then(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 87.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 5 locations. Consider refactoring. Open
this._client.request(
method,
this._buildUrl(path)
).then(
function(result) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 87.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 5 locations. Consider refactoring. Open
this._client.request(
'LOCK',
options.pathIsUrl ? path : this._buildUrl(path),
{},
lockBody
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 87.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 5 locations. Consider refactoring. Open
this._client.request(
'UNLOCK',
options.pathIsUrl ? path : this._buildUrl(path),
{
'Lock-Token': token
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 87.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76