qcminecraft/Carbon-Forum-F

View on GitHub

Showing 851 of 851 total issues

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

        initContainer: function () {
            this.container.innerHTML = '';
            this.list = document.createElement('ul');
            this.clearFloat = document.createElement('li');

Severity: Major
Found in static/editor/dialogs/attachment/attachment.js and 1 other location - About 5 hrs to fix
static/editor/dialogs/image/image.js on lines 799..809

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

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

        initContainer: function () {
            this.container.innerHTML = '';
            this.list = document.createElement('ul');
            this.clearFloat = document.createElement('li');

Severity: Major
Found in static/editor/dialogs/image/image.js and 1 other location - About 5 hrs to fix
static/editor/dialogs/attachment/attachment.js on lines 579..589

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

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

File global.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Carbon-Forum-F
 * https://github.com/lincanbin/Carbon-Forum
 *
 * Copyright 2006-2017 Canbin Lin (lincanbin@hotmail.com)
Severity: Minor
Found in static/js/default/global.js - About 5 hrs to fix

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

            var funcs    =    'abs acos acosh addcslashes addslashes ' +
                            'array_change_key_case array_chunk array_combine array_count_values array_diff '+
                            'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
                            'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
                            'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
    Severity: Major
    Found in static/editor/third-party/SyntaxHighlighter/shCore.js and 1 other location - About 4 hrs to fix
    static/editor/third-party/SyntaxHighlighter/shCore.js on lines 2541..2574

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

    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 funcs    =    'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + 
                            'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + 
                            'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + 
                            'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + 
                            'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + 
    Severity: Major
    Found in static/editor/third-party/SyntaxHighlighter/shCore.js and 1 other location - About 4 hrs to fix
    static/editor/third-party/SyntaxHighlighter/shCore.js on lines 3174..3207

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

    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

    File index.php has 366 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    @set_time_limit(0);
    date_default_timezone_set('Asia/Shanghai'); //设置中国时区
    $Message = '';
    $Version = '5.9.0';
    Severity: Minor
    Found in update/index.php - About 4 hrs to fix

      Function createBody has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createBody()
          {
              $body = '';
              //Create unique IDs and preset boundaries
              $this->uniqueid = md5(uniqid(time()));
      Severity: Minor
      Found in library/PHPMailer.class.php - About 4 hrs 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

      File topic.function.js has 364 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* global $ */
      /*
       * Carbon-Forum-F
       * https://github.com/lincanbin/Carbon-Forum
       *
      Severity: Minor
      Found in static/js/default/topic.function.js - About 4 hrs to fix

        Function addFile has 117 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function addFile(file) {
                        var $li = $('<li id="' + file.id + '">' +
                                '<p class="title">' + file.name + '</p>' +
                                '<p class="imgWrap"></p>' +
                                '<p class="progress"><span></span></p>' +
        Severity: Major
        Found in static/editor/dialogs/video/video.js - About 4 hrs to fix

          Function addFile has 117 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function addFile(file) {
                          var $li = $('<li id="' + file.id + '">' +
                                  '<p class="title">' + file.name + '</p>' +
                                  '<p class="imgWrap"></p>' +
                                  '<p class="progress"><span></span></p>' +
          Severity: Major
          Found in static/editor/dialogs/attachment/attachment.js - About 4 hrs to fix

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

            function renderTemplate(template, list) {
                var buffer = [];
                var temp = '';
                for (var i = 0; i < list.length; i++) {
                    temp = template;
            Severity: Major
            Found in static/js/mobile/global.js and 1 other location - About 4 hrs to fix
            static/js/default/global.js on lines 26..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 127.

            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

            Method authenticate has 115 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function authenticate(
                    $username,
                    $password,
                    $authtype = null,
                    $realm = '',
            Severity: Major
            Found in library/PHPMailer.smtp.class.php - About 4 hrs to fix

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

              function renderTemplate(template, list) {
              
                  var buffer = [];
                  var temp = '';
                  for (var i = 0; i < list.length; i++) {
              Severity: Major
              Found in static/js/default/global.js and 1 other location - About 4 hrs to fix
              static/js/mobile/global.js on lines 187..198

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

              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

              File topic.php has 357 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              if (!defined('InternalAccess')) exit('error: 403 Access Denied');
              ?>
              <script type="text/javascript">
                  var TopicID = <?php echo $ID; ?>;
              Severity: Minor
              Found in view/default/topic.php - About 4 hrs to fix

                SMTP has 35 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class SMTP
                {
                    /**
                     * The PHPMailer SMTP version number.
                     * @var string
                Severity: Minor
                Found in library/PHPMailer.smtp.class.php - About 4 hrs to fix

                  Function addFile has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function addFile(file) {
                                  var $li = $('<li id="' + file.id + '">' +
                                          '<p class="title">' + file.name + '</p>' +
                                          '<p class="imgWrap"></p>' +
                                          '<p class="progress"><span></span></p>' +
                  Severity: Major
                  Found in static/editor/dialogs/image/image.js - About 4 hrs to fix

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

                    <?php
                    if (!defined('InternalAccess')) exit('error: 403 Access Denied');
                    if (empty($Lang) || !is_array($Lang))
                        $Lang = array();
                    
                    
                    Severity: Major
                    Found in language/en/topic.php and 4 other locations - About 4 hrs to fix
                    language/pl/topic.php on lines 1..28
                    language/ru/topic.php on lines 1..28
                    language/zh-cn/topic.php on lines 1..28
                    language/zh-tw/topic.php on lines 1..28

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

                    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

                    <?php
                    if (!defined('InternalAccess')) exit('error: 403 Access Denied');
                    if (empty($Lang) || !is_array($Lang))
                        $Lang = array();
                    
                    
                    Severity: Major
                    Found in language/pl/topic.php and 4 other locations - About 4 hrs to fix
                    language/en/topic.php on lines 1..28
                    language/ru/topic.php on lines 1..28
                    language/zh-cn/topic.php on lines 1..28
                    language/zh-tw/topic.php on lines 1..28

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

                    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

                    <?php
                    if (!defined('InternalAccess')) exit('error: 403 Access Denied');
                    if (empty($Lang) || !is_array($Lang))
                        $Lang = array();
                    
                    
                    Severity: Major
                    Found in language/ru/topic.php and 4 other locations - About 4 hrs to fix
                    language/en/topic.php on lines 1..28
                    language/pl/topic.php on lines 1..28
                    language/zh-cn/topic.php on lines 1..28
                    language/zh-tw/topic.php on lines 1..28

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

                    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

                    <?php
                    if (!defined('InternalAccess')) exit('error: 403 Access Denied');
                    if (empty($Lang) || !is_array($Lang))
                        $Lang = array();
                    
                    
                    Severity: Major
                    Found in language/zh-tw/topic.php and 4 other locations - About 4 hrs to fix
                    language/en/topic.php on lines 1..28
                    language/pl/topic.php on lines 1..28
                    language/ru/topic.php on lines 1..28
                    language/zh-cn/topic.php on lines 1..28

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

                    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