Showing 4,504 of 4,504 total issues
File nl.js
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Selecteer een bestand.",
"File is too big" : "Bestand te groot",
File nb_NO.js
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Vennligst velg en fil.",
"File is too big" : "Filen er for stor",
Function getAssignableAndRemovableGroups
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getAssignableAndRemovableGroups() {
$assignableGroups = [];
$removableGroups = [];
$currentUser = $this->userSession->getUser();
- 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 getDenormalizedData
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getDenormalizedData($calendarData) {
$vObject = Reader::read($calendarData);
$componentType = null;
$component = null;
$firstOccurrence = 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
Function execute
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $input->getOption('user');
$path = $input->getArgument('path');
if ($path === '-') {
$json = \file_get_contents('php://stdin');
- 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 changeUserPassword
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function changeUserPassword($args) {
// Check if we are an user
\OC_JSON::callCheck();
\OC_JSON::checkLoggedIn();
Method rename
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rename($path1, $path2) {
return $this->emittingCall(function () use (&$path1, &$path2) {
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
$result = false;
Method changeSchema
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function changeSchema(Schema $schema, array $options) {
$prefix = $options['tablePrefix'];
if (!$schema->hasTable("{$prefix}external_mounts")) {
$table = $schema->createTable("{$prefix}external_mounts");
$table->addColumn('mount_id', 'bigint', [
AbstractNode
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractNode implements \OCP\Files\Node {
/**
* @inheritdoc
*/
public function getMimePart() {
FileInfo
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
/**
* @var array $data
*/
private $data;
Encryption
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Encryption extends Wrapper {
use LocalTempFileTrait;
/** @var string */
private $mountPoint;
Notification
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Notification implements INotification {
/** @var string */
protected $app;
/** @var string */
OC_User
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class OC_User {
/**
* @return \OC\User\Session
*/
public static function getUserSession() {
User
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class User implements IUser {
use EventEmitterTrait;
/** @var Account */
private $account;
File id.js
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Silakan pilih sebuah berkas.",
"File is too big" : "Berkas terlalu besar",
File DIContainer.php
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @author Christoph Wurst <christoph@owncloud.com>
* @author Joas Schilling <coding@schilljs.com>
File share.js
has 332 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.
Method downloadShare
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function downloadShare($token, $files = null, $path = '', $downloadStartSecret = '') {
\OC_User::setIncognitoMode(true);
$share = $this->shareManager->getShareByToken($token);
Similar blocks of code found in 2 locations. Consider refactoring. Open
$this->create('files.viewcontroller.showFile', '/f/{fileId}')->action(static function ($urlParams) {
$webBaseUrl = \OC::$server->getConfig()->getSystemValue('web.baseUrl', null);
if (!$webBaseUrl) {
// Check the old phoenix.baseUrl system key to provide compatibility across the name change
$webBaseUrl = \OC::$server->getConfig()->getSystemValue('phoenix.baseUrl', null);
- 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 161.
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
$this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(static function ($urlParams) {
$webBaseUrl = \OC::$server->getConfig()->getSystemValue('web.baseUrl', null);
if (!$webBaseUrl) {
// Check the old phoenix.baseUrl system key to provide compatibility across the name change
$webBaseUrl = \OC::$server->getConfig()->getSystemValue('phoenix.baseUrl', null);
- 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 161.
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