Showing 4,504 of 4,504 total issues
Method getPublicCalendars
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPublicCalendars() {
$fields = \array_values($this->propertyMap);
$fields[] = 'a.id';
$fields[] = 'a.uri';
$fields[] = 'a.synctoken';
Method reShare
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reShare($id) {
$token = $this->request->getParam('token', null);
$shareWith = $this->request->getParam('shareWith', null);
$permission = $this->request->getParam('permission', null);
$remoteId = $this->request->getParam('remoteId', null);
Method createCardsPropertiesTable
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createCardsPropertiesTable(Schema $schema) {
if (!$schema->hasTable("{$this->prefix}cards_properties")) {
$table = $schema->createTable("{$this->prefix}cards_properties");
$table->addColumn('id', 'integer', [
'autoincrement' => true,
Method createTag
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createTag($data, $contentType = 'application/json'): ISystemTag {
if (\explode(';', $contentType)[0] === 'application/json') {
$data = \json_decode($data, true);
} else {
throw new UnsupportedMediaType();
Method handleGetProperties
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleGetProperties(PropFind $propFind, INode $node) {
if ($node instanceof MetaFolder) {
$propFind->handle(self::PATH_FOR_FILEID_PROPERTYNAME, function () use ($node) {
$fileId = $node->getName();
Method rename
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rename($path1, $path2) {
$file = $this->getDriveFile($path1);
if ($file) {
$newFile = $this->getDriveFile($path2);
$toUpdate = new DriveFile();
Method doFind
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doFind($script) {
$fullScript = $this->addExtension($script);
$themeDirectory = $this->theme->getDirectory();
$baseDirectory = $this->theme->getBaseDirectory();
$webRoot = '';
Method file_put_contents
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function file_put_contents($path, $data) {
return $this->emittingCall(function () use (&$path, &$data) {
if (\is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (Filesystem::isValidPath($path)
Method update
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($id, array $data) {
unset(self::$path_cache[(int)$id]);
if (isset($data['path'])) {
// normalize path
$data['path'] = $this->normalize($data['path']);
Method scan
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function scan($dir = '') {
if (!Filesystem::isValidPath($dir)) {
throw new \InvalidArgumentException('Invalid path to scan');
}
$mounts = $this->getMounts($dir);
Method fopen
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fopen($path, $mode) {
$path = $this->normalizePath($path);
switch ($mode) {
case 'r':
Method getMountsForUser
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
$mounts = [];
// setUser is in UserTrait.
/* @phan-suppress-next-line PhanUndeclaredMethod */
Method handleChildren
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleChildren($path, $recursive, $reuse, $folderId, $lock, &$size) {
// we put this in it's own function so it cleans up the memory before we start recursing
$existingChildren = $this->getExistingChildren($folderId);
$newChildren = $this->getNewChildren($path);
Method centerCrop
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function centerCrop($size = 0) {
if (!$this->valid()) {
$this->logger->error('OC_Image->centerCrop, No image loaded', ['app' => 'core']);
return false;
}
Method syncMultipleUsers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function syncMultipleUsers(
InputInterface $input,
OutputInterface $output,
SyncService $syncService,
UserInterface $backend,
Similar blocks of code found in 2 locations. Consider refactoring. Open
_.extend(OC.Files.Client, {
PROPERTY_SHARE_TYPES: '{' + OC.Files.Client.NS_OWNCLOUD + '}share-types',
PROPERTY_OWNER_DISPLAY_NAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name'
});
- 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 71.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
_.extend(OC.Files.Client, {
PROPERTY_TAGS: '{' + OC.Files.Client.NS_OWNCLOUD + '}tags',
PROPERTY_FAVORITE: '{' + OC.Files.Client.NS_OWNCLOUD + '}favorite'
});
- 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 71.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
$(dialogId).find('.allnewfiles').on('click', function() {
var $checkboxes = $(dialogId).find('.conflict .replacement input[type="checkbox"]');
$checkboxes.prop('checked', $(this).prop('checked'));
});
- 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 71.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
$(dialogId).find('.allexistingfiles').on('click', function() {
var $checkboxes = $(dialogId).find('.conflict .original:not(.readonly) input[type="checkbox"]');
$checkboxes.prop('checked', $(this).prop('checked'));
});
- 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 71.
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
Function _onClickDeleteSelected
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onClickDeleteSelected: function(event) {
event.preventDefault();
var self = this;
var allFiles = this.$el.find('.select-all').is(':checked');
var files = [];