Showing 4,504 of 4,504 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
case IMAGETYPE_PNG:
if (\imagetypes() & IMG_PNG) {
$this->resource = \imagecreatefrompng($imagePath);
// Preserve transparency
\imagealphablending($this->resource, true);
- 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 103.
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 (!$publicShare) {
$query = \OC_DB::prepare(
'
SELECT `share_with`
FROM `*PREFIX*share`
- 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 103.
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 (!$remoteShare) {
$query = \OC_DB::prepare(
'
SELECT `share_with`
FROM `*PREFIX*share`
- 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 103.
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
case IMAGETYPE_GIF:
if (\imagetypes() & IMG_GIF) {
$this->resource = \imagecreatefromgif($imagePath);
// Preserve transparency
\imagealphablending($this->resource, true);
- 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 103.
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 share
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback, errorCallback) {
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
string $appName,
IRequest $request,
MailNotifications $mailNotifications,
IUserSession $userSession,
IUserManager $userManager,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
OcmMiddleware $ocmMiddleware,
IURLGenerator $urlGenerator,
IUserManager $userManager,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
IJobList $jobList,
ISecureRandom $secureRandom,
IConfig $config,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
IURLGenerator $urlGenerator,
IL10N $l10n,
IConfig $config,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
IRequest $request,
ControllerMethodReflector $reflector,
INavigationManager $navigationManager,
IURLGenerator $urlGenerator,
ILogger $logger,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
IUserManager $manager,
ISession $session,
ITimeFactory $timeFactory,
IProvider $tokenProvider,
IConfig $config,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
IUserManager $userManager,
IConfig $config,
ISession $session,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
IAvatarManager $avatarManager,
File $cache,
IL10N $l10n,
Function _addAppPassword
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_addAppPassword: function() {
var _this = this;
var deviceName = this._tokenName.val();
if (!deviceName) {
Function getDefaultFileActions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDefaultFileActions: function(mime, type, permissions) {
var mimePart;
if (mime) {
mimePart = mime.substr(0, mime.indexOf('/'));
}
Function uploads
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
selection.uploads = _.filter(selection.uploads, function(upload) {
var file = upload.getFile();
if (file.relativePath) {
// can't check in subfolder contents, let backend handle this
return true;
Function _legacyFillCurrentShares
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_legacyFillCurrentShares: function(shares) {
var fileId = this.fileInfoModel.get('id');
if (!shares || !shares.length) {
delete OC.Share.statuses[fileId];
OC.Share.currentShares = {};
Function _handleAddShareAttributes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleAddShareAttributes: function(properties, options) {
var shareAttributesV1 = [];
var filteredRegisteredAttributes = this._filterRegisteredAttributes(properties.permissions);
_.map(filteredRegisteredAttributes, function (filteredRegisteredAttribute) {
var isCompatible = true;
Function renderFileResult
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.renderFileResult = function($row, result) {
if (inFileList($row, result)) {
return null;
}
hideNoFilterResults();
Function getFileInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFileInfo: function(path, options) {
if (!path) {
path = '';
}
options = options || {};