Showing 4,504 of 4,504 total issues
Function toXML
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function toXML($array, $writer) {
foreach ($array as $k => $v) {
if (isset($k[0]) && ($k[0] === '@')) {
if (\is_array($v)) {
foreach ($v as $name => $value) {
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$appSteps = $this->getAppsRepairSteps($output);
// Handle listing repair steps
$steps = \array_merge(
\OC\Repair::getRepairSteps(),
- 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 tryLogin
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function tryLogin($user, $password, $redirect_url, $timezone = null, $remember_login = null) {
$originalUser = $user;
// TODO: Add all the insane error handling
$loginResult = $this->userSession->login($user, $password);
if ($loginResult !== true && $this->config->getSystemValue('strict_login_enforced', false) !== true) {
- 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
Similar blocks of code found in 3 locations. Consider refactoring. Open
$('#sqlite').click(function() {
$('#use_other_db').slideUp(250);
$('#use_oracle_db').slideUp(250);
$('#sqliteInformation').show();
$('#dbname').attr('pattern','[0-9a-zA-Z$_-]+');
- 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 80.
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 3 locations. Consider refactoring. Open
$('#mysql,#pgsql').click(function() {
$('#use_other_db').slideDown(250);
$('#use_oracle_db').slideUp(250);
$('#sqliteInformation').hide();
$('#dbname').attr('pattern','[0-9a-zA-Z$_-]+');
- 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 80.
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 3 locations. Consider refactoring. Open
$('#oci').click(function() {
$('#use_other_db').slideDown(250);
$('#use_oracle_db').show(250);
$('#sqliteInformation').hide();
$('#dbname').attr('pattern','[0-9a-zA-Z$_-.]+');
- 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 80.
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 _createFileActions
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createFileActions: function() {
var fileActions = new OCA.Files.FileActions();
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
var dir = context.fileList.getCurrentDirectory();
context.fileList.changeDirectory(OC.joinPaths(dir, filename));
Function _addConvenienceMethods
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
_addConvenienceMethods: function (e, data) {
var that = this,
getPromise = function (args) {
return $.Deferred().resolveWith(that, args).promise();
};
Function updateIcons
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateIcons:function(itemType, fileList){
var item;
var $fileList;
var currentDir;
if (!fileList && OCA.Files) {
Method getNodeForPath
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getNodeForPath($path) {
if (!$this->fileView) {
throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
}
Method configure
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure() {
parent::configure();
$this
->setName('files:scan')
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
$message = $this->mailer->createMessage();
$message->setTo([$mailAddress => $userId]);
$message->setSubject($this->l10n->t('%s email address confirm', [$this->defaults->getName()]));
$message->setPlainBody($msg);
- 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 126.
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
try {
$message = $this->mailer->createMessage();
$message->setTo([$oldEmailAddress => $userId]);
$message->setSubject($this->l10n->t('%s email address changed successfully', [$this->defaults->getName()]));
$message->setPlainBody($msg);
- 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 126.
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
File eu.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Mesedez, hautatu fitxategia.",
"File is too big" : "Fitxategia handiegia da",
Function _onClickRevertVersion
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onClickRevertVersion: function(ev) {
var self = this;
var $target = $(ev.target);
var fileInfoModel = this.versionsRoot.getFileInfo();
var revision;
Function _renderRow
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderRow: function(fileData, options) {
options = options || {};
var type = fileData.type || 'file',
mime = fileData.mimetype,
path = fileData.path || this.getCurrentDirectory(),
Function _extendFileActions
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
_extendFileActions: function(fileList) {
var self = this;
fileList.fileActions.registerAction({
name: 'lock-status',
displayName: t('files', 'Lock status'),
Method checkStorageAvailability
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkStorageAvailability() {
// WARNING: Disabling this setting is recommended only in tightly integrated federated setups as temporarly setting,
// should NOT be used in decentralized federation setup. It could cause bad user experience when dealing
// with deleted external shares
// NOTE: This allows administrator to disable cleanup of invalid shares so only manual removal by user or admin is possible,
Method createShare
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createShare(
Address $ownerAddress,
Address $sharedByAddress,
$shareWith,
$remoteId,
Method createFederatedShare
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createFederatedShare(IShare $share) {
$token = $this->tokenHandler->generateToken();
$shareId = $this->addShareToDB(
$share->getNodeId(),
$share->getNodeType(),