spotweb/spotweb

View on GitHub

Showing 850 of 850 total issues

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

                        $.each(data.errors, function(key, val) {
                            $formerrors.append("<li>" + val + "</li>");
                        }); // each
Severity: Minor
Found in templates/we1rdo/js/spotdialogs.js and 1 other location - About 30 mins to fix
templates/mobile/includes/js/spotdialogs.js on lines 56..58

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

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

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

        } else if ( btn ) {
            btn.removeClass( "ui-btn-left ui-btn-right" ).addClass( "ui-btn-" + location );
            if ( text ) {
                btn.text( text );
            }
Severity: Minor
Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 30 mins to fix
js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 6646..6660

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

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

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

                        $.each(data.errors, function(key, val) {
                            $formerrors.append("<li>" + val + "</li>");
                        }); // each
Severity: Minor
Found in templates/mobile/includes/js/spotdialogs.js and 1 other location - About 30 mins to fix
templates/we1rdo/js/spotdialogs.js on lines 87..89

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

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

Avoid too many return statements within this method.
Open

                return;
Severity: Major
Found in lib/gettext/Gettext_PHP.php - About 30 mins to fix

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

                            $("span.commentcount").html('# '+$("#commentslist").children().not(".addComment").size());
    Severity: Minor
    Found in js/posting/posting.js and 1 other location - About 30 mins to fix
    templates/we1rdo/js/scripts.js on lines 213..213

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

    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

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

                $("span.commentcount").html('# '+$("#commentslist").children().not(".addComment").size());
    Severity: Minor
    Found in templates/we1rdo/js/scripts.js and 1 other location - About 30 mins to fix
    js/posting/posting.js on lines 38..38

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

    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

                        samePath = u.hrefNoHash === this.documentUrl.hrefNoHash ||
                            ( this.documentBaseDiffers &&
                                u.hrefNoHash === this.documentBase.hrefNoHash ),
    Severity: Minor
    Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 30 mins to fix
    js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 2629..2629

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

    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

                screen
                    .removeClass( this._themeClassFromOption( "ui-overlay-", currentOptions.overlayTheme ) )
                    .addClass( this._themeClassFromOption( "ui-overlay-", newOptions.overlayTheme ) );
    Severity: Minor
    Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 30 mins to fix
    js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 10600..10602

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

    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

                        return ( !this.isPath(u.hash) && u.hash && ( u.hrefNoHash === this.documentUrl.hrefNoHash || ( this.documentBaseDiffers && u.hrefNoHash === this.documentBase.hrefNoHash ) ) );
    Severity: Minor
    Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 30 mins to fix
    js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 2735..2737

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

    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

                theElement
                    .removeClass( this._themeClassFromOption( "ui-body-", currentOptions.theme ) )
                    .addClass( this._themeClassFromOption( "ui-body-", newOptions.theme ) );
    Severity: Minor
    Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 30 mins to fix
    js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 10606..10608

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

    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

    Function downloadSabnzbd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function downloadSabnzbd(id,url, dltype) {
        $(".sab_"+id).removeClass("succes").addClass("loading");
        
        /*
         * Get the URL, do not rely on the result handler always
    Severity: Minor
    Found in templates/we1rdo/js/scripts.js - About 25 mins to fix

    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 isXsrfValid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function isXsrfValid($form)
        {
            if (!isset($_POST[$form]['xsrfid'])) {
                return false;
            } // if
    Severity: Minor
    Found in lib/SpotReq.php - About 25 mins to fix

    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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render()
        {
            $tplHelper = $this->_tplHelper;
    
            /* Make sure users has sufficient permission to perform this action */
    Severity: Minor
    Found in lib/page/SpotPage_statics.php - About 25 mins to fix

    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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function connect($host, $user, $pass, $db, $port, $schema)
        {
            if (!$this->_conn instanceof PDO) {
                if ($host[0] === '/') {
                    $db_conn = 'unix_socket='.$host;
    Severity: Minor
    Found in lib/dbeng/dbeng_pdo_mysql.php - About 25 mins to fix

    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 fetchFullSpot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function fetchFullSpot($msgId, $ourUserId)
        {
            SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
    
            /*
    Severity: Minor
    Found in lib/services/Providers/Services_Providers_FullSpot.php - About 25 mins to fix

    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 Cat2Desc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function Cat2Desc($hcat, $cat)
        {
            $catList = explode('|', $cat);
            $cat = $catList[0];
    
    
    Severity: Minor
    Found in lib/SpotCategories.php - About 25 mins to fix

    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 convertBmpImageStringToJpeg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function convertBmpImageStringToJpeg($imageString, $dimensions)
        {
            /*
             * If this fil is currently an BMP, change it to an
             * JPG file
    Severity: Minor
    Found in lib/services/Image/Services_Image_BmpConverter.php - About 25 mins to fix

    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 arrayKeyToInForComments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function arrayKeyToInForComments($ar)
        {
            $tmpList = '';
    
            if (!is_array($ar) || count($ar) == 0) {
    Severity: Minor
    Found in lib/dbeng/dbeng_abs.php - About 25 mins to fix

    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 getFullSpot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getFullSpot(array $currentSession, $msgId, $markAsRead)
        {
            // Make sure user has access to the spot
            $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
    
    
    Severity: Minor
    Found in lib/services/Actions/Services_Actions_GetSpot.php - About 25 mins to fix

    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 time_ago has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function time_ago($date, $granularity = 2)
        {
            $difference = time() - $date;
            $periods = ['decade' => 315360000,
                'year'           => 31536000,
    Severity: Minor
    Found in lib/SpotTemplateHelper.php - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language