Showing 4,504 of 4,504 total issues
Method validateExpireDate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function validateExpireDate($expireDate, $shareTime, $itemType, $itemSource) {
$l = \OC::$server->getL10N('lib');
$date = new \DateTime($expireDate);
$today = new \DateTime('now');
Method processSimpleRoutes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processSimpleRoutes($routes) {
$simpleRoutes = isset($routes['routes']) ? $routes['routes'] : [];
foreach ($simpleRoutes as $simpleRoute) {
$name = $simpleRoute['name'];
$postfix = '';
Method isCached
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isCached() {
$fileId = $this->getFile()->getId();
if ($fileId === null) {
return false;
}
Method isAppCompatible
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isAppCompatible($ocVersion, $appInfo) {
$requireMin = '';
$requireMax = '';
if (isset($appInfo['dependencies']['owncloud']['@attributes']['min-version'])) {
$requireMin = $appInfo['dependencies']['owncloud']['@attributes']['min-version'];
Method getShippedApps
has 28 lines of code (exceeds 25 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']);
Method useBackend
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function useBackend($backend = 'database') {
if ($backend instanceof \OCP\UserInterface) {
self::$_usedBackends[\get_class($backend)] = $backend;
\OC::$server->getUserManager()->registerBackend($backend);
} else {
Method getUidAndFilename
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUidAndFilename($path) {
list($storage, $internalPath) = $this->rootView->resolvePath($path);
$absMountPoint = $this->rootView->getMountPoint($path);
$parts = \explode('/', $absMountPoint);
Method set
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set($data) {
if ($data instanceof IImage) {
$img = $data;
$data = $img->data();
} else {
Method getForObject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForObject(
$objectType,
$objectId,
$limit = 0,
$offset = 0,
Method convertDB
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertDB(Connection $fromDB, Connection $toDB, array $tables, InputInterface $input, OutputInterface $output) {
$this->config->setSystemValue('maintenance', true);
try {
$fromSchema = $fromDB->createSchema();
// copy table rows
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$privateKeyPath = $input->getOption('privateKey');
$keyBundlePath = $input->getOption('certificate');
$path = $input->getOption('path');
if ($privateKeyPath === null || $keyBundlePath === null || $path === null) {
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
if (!$this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$output->writeln("<error>This command is only valid for MySQL/MariaDB databases.</error>");
return 1;
}
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$importFile = $input->getArgument('file');
if ($importFile !== null) {
$content = $this->getArrayFromFile($importFile);
} else {
Method checkInput
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkInput(InputInterface $input) {
$uid = $input->getArgument('uid');
if (!$input->getOption('ignore-missing-user') && !$this->userManager->userExists($uid)) {
throw new \InvalidArgumentException('The user "' . $uid . '" does not exist.');
}
Method showChallenge
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showChallenge($challengeProviderId, $redirect_url) {
$user = $this->userSession->getUser();
$provider = $this->twoFactorManager->getProvider($user, $challengeProviderId);
if ($provider === null) {
return new RedirectResponse($this->urlGenerator->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
Similar blocks of code found in 2 locations. Consider refactoring. Open
url: function() {
return OC.linkToRemote('dav') + '/comments/' +
encodeURIComponent(this._objectType) + '/' +
encodeURIComponent(this.id) + '/';
}
- 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 57.
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
if (file.type === 'dir' || file.mime === 'httpd/unix-directory') {
this.summary.totalDirs++;
}
else {
this.summary.totalFiles++;
- 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 57.
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
} else {
if ($.trim(email) === '') {
OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
message: t('settings', 'A valid email must be provided')
}));
- 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 57.
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
enableActions: function() {
this.$el.find('.action').css('display', 'inline');
this.$el.find('input:checkbox').removeClass('u-hidden');
},
- 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 57.
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
if (file.type === 'dir' || file.mime === 'httpd/unix-directory') {
this.summary.totalDirs--;
}
else {
this.summary.totalFiles--;
- 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 57.
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