owncloud/core

View on GitHub

Showing 1,269 of 4,504 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        $(document).on('click', '#apps-list input.update', function () {
            var appId = $(this).data('appid');
            var element = $(this);

            OC.Settings.Apps.updateApp(appId, element);
Severity: Major
Found in settings/js/admin-apps.js and 1 other location - About 1 hr to fix
settings/js/admin-apps.js on lines 617..622

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 72.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        $(document).on('click', '#apps-list input.uninstall', function () {
            var appId = $(this).data('appid');
            var element = $(this);

            OC.Settings.Apps.uninstallApp(appId, element);
Severity: Major
Found in settings/js/admin-apps.js and 1 other location - About 1 hr to fix
settings/js/admin-apps.js on lines 624..629

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 72.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    private function checkBlackListMethod($class, $functionName, Node $node) {
        $name = $class . '::' . $functionName;
        $lowerName = \strtolower($name);

        if (isset($this->blackListedMethods[$lowerName])) {
Severity: Major
Found in lib/private/App/CodeChecker/NodeVisitor.php and 2 other locations - About 1 hr to fix
lib/private/App/CodeChecker/NodeVisitor.php on lines 257..269
lib/private/App/CodeChecker/NodeVisitor.php on lines 271..283

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 117.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    private function checkBlackListConstant($class, $constantName, Node $node) {
        $name = $class . '::' . $constantName;
        $lowerName = \strtolower($name);

        if (isset($this->blackListedConstants[$lowerName])) {
Severity: Major
Found in lib/private/App/CodeChecker/NodeVisitor.php and 2 other locations - About 1 hr to fix
lib/private/App/CodeChecker/NodeVisitor.php on lines 271..283
lib/private/App/CodeChecker/NodeVisitor.php on lines 285..297

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 117.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    private function checkBlackListFunction($class, $functionName, Node $node) {
        $name = $class . '::' . $functionName;
        $lowerName = \strtolower($name);

        if (isset($this->blackListedFunctions[$lowerName])) {
Severity: Major
Found in lib/private/App/CodeChecker/NodeVisitor.php and 2 other locations - About 1 hr to fix
lib/private/App/CodeChecker/NodeVisitor.php on lines 257..269
lib/private/App/CodeChecker/NodeVisitor.php on lines 285..297

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 117.

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

Further Reading

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'
    });
Severity: Major
Found in apps/files_sharing/js/share.js and 1 other location - About 1 hr to fix
apps/files/js/tagsplugin.js on lines 15..18

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

Further Reading

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'
    });
Severity: Major
Found in apps/files/js/tagsplugin.js and 1 other location - About 1 hr to fix
apps/files_sharing/js/share.js on lines 13..16

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

Further Reading

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'));
                });
Severity: Major
Found in core/js/oc-dialogs.js and 1 other location - About 1 hr to fix
core/js/oc-dialogs.js on lines 639..642

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

Further Reading

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'));
                });
Severity: Major
Found in core/js/oc-dialogs.js and 1 other location - About 1 hr to fix
core/js/oc-dialogs.js on lines 635..638

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public function __construct(
        IGroupManager $groupManager,
        IManager $activityManager,
        IUserSession $session,
        ISystemTagManager $tagManager,
Severity: Major
Found in apps/systemtags/lib/Activity/Listener.php and 4 other locations - About 1 hr to fix
apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
apps/federation/lib/TrustedServers.php on lines 77..93
lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92
lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

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 116.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public function __construct(
        DbHandler $dbHandler,
        IClientService $httpClientService,
        ILogger $logger,
        IJobList $jobList,
Severity: Major
Found in apps/federation/lib/TrustedServers.php and 4 other locations - About 1 hr to fix
apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
apps/systemtags/lib/Activity/Listener.php on lines 67..83
lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92
lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

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 116.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public function __construct(
        IConfig $config,
        IDBConnection $connection,
        IUserManager $userManager,
        IAvatarManager $avatarManager,
Severity: Major
Found in lib/private/Repair/MoveAvatarOutsideHome.php and 4 other locations - About 1 hr to fix
apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
apps/federation/lib/TrustedServers.php on lines 77..93
apps/systemtags/lib/Activity/Listener.php on lines 67..83
lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92

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 116.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public function __construct(
        IConfig $config,
        IDBConnection $connection,
        IUserManager $userManager,
        IAvatarManager $avatarManager,
Severity: Major
Found in lib/private/Repair/MoveAvatarIntoSubFolder.php and 4 other locations - About 1 hr to fix
apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
apps/federation/lib/TrustedServers.php on lines 77..93
apps/systemtags/lib/Activity/Listener.php on lines 67..83
lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

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 116.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public function __construct(
        FederatedShareProvider $federatedShareProvider,
        Notifications $notifications,
        IUserManager $userManager,
        ActivityManager $activityManager,
Severity: Major
Found in apps/federatedfilesharing/lib/FedShareManager.php and 4 other locations - About 1 hr to fix
apps/federation/lib/TrustedServers.php on lines 77..93
apps/systemtags/lib/Activity/Listener.php on lines 67..83
lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92
lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

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 116.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (! \pg_fetch_row($result)) {
            //user does not exist, so let's create them :)
            $query = "CREATE USER \"$e_name\" CREATEDB PASSWORD '$e_password';";
            $result = \pg_query($connection, $query);
            if (!$result) {
Severity: Major
Found in lib/private/Setup/PostgreSQL.php and 1 other location - About 1 hr to fix
lib/private/Setup/PostgreSQL.php on lines 167..175

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 116.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        } else { // change password of the existing role
            $query = "ALTER ROLE \"$e_name\" WITH PASSWORD '$e_password';";
            $result = \pg_query($connection, $query);
            if (!$result) {
                $entry = $this->trans->t('DB Error: "%s"', [\pg_last_error($connection)]) . '<br />';
Severity: Major
Found in lib/private/Setup/PostgreSQL.php and 1 other location - About 1 hr to fix
lib/private/Setup/PostgreSQL.php on lines 158..175

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 116.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('#pass2').strengthify({
        zxcvbn: OC.linkTo('core','vendor/zxcvbn/dist/zxcvbn.js'),
        titles: [
            t('settings', 'Very weak password'),
            t('settings', 'Weak password'),
Severity: Major
Found in settings/js/panels/profile.js and 1 other location - About 1 hr to fix
core/js/setup.js on lines 109..119

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 70.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $('#adminpass').strengthify({
        zxcvbn: OC.linkTo('core','vendor/zxcvbn/dist/zxcvbn.js'),
        titles: [
            t('core', 'Very weak password'),
            t('core', 'Weak password'),
Severity: Major
Found in core/js/setup.js and 1 other location - About 1 hr to fix
settings/js/panels/profile.js on lines 312..322

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 70.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    var COMMENT_TEMPLATE =
        '<li class="comment{{#if isUnread}} unread{{/if}}{{#if isLong}} collapsed{{/if}}" data-id="{{id}}">' +
        '    <div class="authorRow">' +
        '        {{#if avatarEnabled}}' +
        '        <div class="avatar" {{#if actorId}}data-username="{{actorId}}"{{/if}}> </div>' +
Severity: Major
Found in apps/comments/js/commentstabview.js and 1 other location - About 1 hr to fix
apps/files/js/fileactionsmenu.js on lines 13..29

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 69.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    var TEMPLATE_MENU =
        '<ul>' +
        '{{#each items}}' +
        '<li>' +
        '<a href="#" class="menuitem action action-{{nameLowerCase}} permanent" data-action="{{name}}">' +
Severity: Major
Found in apps/files/js/fileactionsmenu.js and 1 other location - About 1 hr to fix
apps/comments/js/commentstabview.js on lines 43..59

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 69.

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

Further Reading

Severity
Category
Status
Source
Language