adobe/brackets

View on GitHub
src/extensions/default/InAppNotifications/main.js

Summary

Maintainability
C
1 day
Test Coverage

Function _getNotificationInformation has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function _getNotificationInformation(_notificationInfoUrl) {
        // Last time the versionInfoURL was fetched
        var lastInfoURLFetchTime = PreferencesManager.getViewState("lastNotificationURLFetchTime");

        var result = new $.Deferred();
Severity: Major
Found in src/extensions/default/InAppNotifications/main.js - About 2 hrs to fix

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

                    $.ajax({
                        url: localNotificationInfoUrl,
                        dataType: "json",
                        cache: false
                    }).done(function (notificationInfo, textStatus, jqXHR) {
    Severity: Major
    Found in src/extensions/default/InAppNotifications/main.js and 1 other location - About 2 hrs to fix
    src/utils/UpdateNotification.js on lines 201..229

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

    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 4 locations. Consider refactoring.
    Open

        var AppInit              = brackets.getModule("utils/AppInit"),
            PreferencesManager   = brackets.getModule("preferences/PreferencesManager"),
            ExtensionUtils       = brackets.getModule("utils/ExtensionUtils"),
            ExtensionManager     = brackets.getModule("extensibility/ExtensionManager"),
            HealthLogger         = brackets.getModule("utils/HealthLogger"),
    Severity: Major
    Found in src/extensions/default/InAppNotifications/main.js and 3 other locations - About 1 hr to fix
    src/extensions/default/AutoUpdate/UpdateInfoBar.js on lines 27..32
    src/extensions/default/PhpTooling/PHPSymbolProviders.js on lines 29..33
    src/extensions/default/PhpTooling/unittests.js on lines 27..31

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

    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

        function _checkLocale(filters, _locale) {
            return !filters.locales || filters.locales.length === 0 || filters.locales.indexOf(_locale) >=0;
        }
    Severity: Major
    Found in src/extensions/default/InAppNotifications/main.js and 2 other locations - About 1 hr to fix
    src/extensions/default/InAppNotifications/main.js on lines 194..196
    src/extensions/default/InAppNotifications/main.js on lines 198..200

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

    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

        function _checkPlatform(filters, _platform) {
            return !filters.platforms || filters.platforms.length === 0 || filters.platforms.indexOf(_platform) >=0;
        }
    Severity: Major
    Found in src/extensions/default/InAppNotifications/main.js and 2 other locations - About 1 hr to fix
    src/extensions/default/InAppNotifications/main.js on lines 198..200
    src/extensions/default/InAppNotifications/main.js on lines 207..209

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

    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

        function _checkBuild(filters, _build) {
            return !filters.builds || filters.builds.length === 0 || filters.builds.indexOf(_build) >=0;
        }
    Severity: Major
    Found in src/extensions/default/InAppNotifications/main.js and 2 other locations - About 1 hr to fix
    src/extensions/default/InAppNotifications/main.js on lines 194..196
    src/extensions/default/InAppNotifications/main.js on lines 207..209

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

    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

    There are no issues that match your filters.

    Category
    Status