qcminecraft/Carbon-Forum-F

View on GitHub

Showing 851 of 851 total issues

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

    if (DraftContent) {
        UE.getEditor('editor').setContent(DraftContent);
    } else {
        UE.getEditor('editor').execCommand('cleardoc');
    }
Severity: Minor
Found in static/js/default/new.function.js and 1 other location - About 40 mins to fix
static/js/default/topic.function.js on lines 449..453

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

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

    var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
        replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, "");
Severity: Minor
Found in static/editor/dialogs/searchreplace/searchreplace.js and 1 other location - About 40 mins to fix
static/editor/dialogs/searchreplace/searchreplace.js on lines 141..142

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

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

Consider simplifying this complex logical expression.
Open

    if (!$SignatureTime || !$SignatureKey || !$SignatureValue || empty($APISignature[$SignatureKey]) || abs($SignatureTime - $TimeStamp) > 600 || !HashEquals($SignatureValue, md5($SignatureKey . $APISignature[$SignatureKey] . $SignatureTime))) {
        AlertMsg('403', 'Forbidden', 403);
    }
Severity: Major
Found in common.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

    if ($CurUserExpirationTime > $TimeStamp && $CurUserExpirationTime < ($TimeStamp + 2678400) && $CurUserID && $CurUserCode) {
        $TempUserInfo = array();
        if ($MCache) {
            $TempUserInfo = $MCache->get(MemCachePrefix . 'UserInfo_' . $CurUserID);
        }
    Severity: Major
    Found in common.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (obj) {
                  var color = obj['background-color'],
                      repeat = obj['background-repeat'] || 'repeat',
                      image = obj['background-image'] || '',
                      position = obj['background-position'] || 'center center',
      Severity: Major
      Found in static/editor/dialogs/background/background.js - About 40 mins to fix

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

            navigator: {
                handles: {
                    backgroundColor: '#666',
                    borderColor: '#AAA'
                },
        Severity: Minor
        Found in static/editor/third-party/highcharts/themes/gray.js and 2 other locations - About 40 mins to fix
        static/editor/third-party/highcharts/themes/dark-blue.js on lines 203..214
        static/editor/third-party/highcharts/themes/dark-green.js on lines 204..215

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

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

            navigator: {
                handles: {
                    backgroundColor: '#666',
                    borderColor: '#AAA'
                },
        Severity: Minor
        Found in static/editor/third-party/highcharts/themes/dark-blue.js and 2 other locations - About 40 mins to fix
        static/editor/third-party/highcharts/themes/dark-green.js on lines 204..215
        static/editor/third-party/highcharts/themes/gray.js on lines 206..217

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

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

            navigator: {
                handles: {
                    backgroundColor: '#666',
                    borderColor: '#AAA'
                },
        Severity: Minor
        Found in static/editor/third-party/highcharts/themes/dark-green.js and 2 other locations - About 40 mins to fix
        static/editor/third-party/highcharts/themes/dark-blue.js on lines 203..214
        static/editor/third-party/highcharts/themes/gray.js on lines 206..217

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

        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

        baidu.lang.isFunction = function (source) {
            return '[object Function]' == Object.prototype.toString.call(source);
        };
        Severity: Minor
        Found in static/editor/dialogs/wordimage/tangram.js and 1 other location - About 40 mins to fix
        static/editor/dialogs/wordimage/tangram.js on lines 512..514

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

        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

        baidu.lang.isArray = function (source) {
            return '[object Array]' == Object.prototype.toString.call(source);
        };
        Severity: Minor
        Found in static/editor/dialogs/wordimage/tangram.js and 1 other location - About 40 mins to fix
        static/editor/dialogs/wordimage/tangram.js on lines 124..126

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

        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 Reply has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function Reply(UserName, PostFloor, PostID, FormHash, TopicID) {
        Severity: Minor
        Found in static/js/mobile/global.js - About 35 mins to fix

          Function getHTML has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  getHTML: function(sfrom, sto, includePre, tabText, endAt) {
          Severity: Minor
          Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

            Function updateLinesNoUndo has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
            Severity: Minor
            Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

              Function load has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  var load = function (protocol, domains, path, query, cb) {
              Severity: Minor
              Found in static/js/gt.js - About 35 mins to fix

                Function clipTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        clipTo: function(fromOpen, from, toOpen, to, diff) {
                Severity: Minor
                Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                  Function addWidget has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              addWidget: function(pos, node, scroll, vert, horiz) {
                  Severity: Minor
                  Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                    Function clipTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            clipTo: function(fromOpen, from, toOpen, to, diff) {
                    Severity: Minor
                    Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                      Function parseJS has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function parseJS(state, style, type, content, stream) {
                      Severity: Minor
                      Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                        Function Manage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function Manage(ID, Type, Action, NeedToConfirm, TargetTag) {
                        Severity: Minor
                        Found in static/js/mobile/global.js - About 35 mins to fix

                          Function updateLines has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  function updateLines(from, to, newText, selFrom, selTo) {
                          Severity: Minor
                          Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language