qcminecraft/Carbon-Forum-F

View on GitHub

Showing 851 of 851 total issues

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-cn/tag.php and 4 other locations - About 3 hrs to fix
language/en/tag.php on lines 1..29
language/pl/tag.php on lines 1..29
language/ru/tag.php on lines 1..29
language/zh-tw/tag.php on lines 1..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 161.

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/en/tag.php and 4 other locations - About 3 hrs to fix
language/pl/tag.php on lines 1..29
language/ru/tag.php on lines 1..29
language/zh-cn/tag.php on lines 1..29
language/zh-tw/tag.php on lines 1..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 161.

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/tag.php and 4 other locations - About 3 hrs to fix
language/en/tag.php on lines 1..29
language/ru/tag.php on lines 1..29
language/zh-cn/tag.php on lines 1..29
language/zh-tw/tag.php on lines 1..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 161.

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/tag.php and 4 other locations - About 3 hrs to fix
language/en/tag.php on lines 1..29
language/pl/tag.php on lines 1..29
language/ru/tag.php on lines 1..29
language/zh-cn/tag.php on lines 1..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 161.

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/tag.php and 4 other locations - About 3 hrs to fix
language/en/tag.php on lines 1..29
language/pl/tag.php on lines 1..29
language/zh-cn/tag.php on lines 1..29
language/zh-tw/tag.php on lines 1..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 161.

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 favorite has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function favorite($IsFavorite, $FavoriteType)
    {
        global $TimeStamp, $CurUserID;
        Auth(1);
        //$IsFavorite: 检查主题/标签/用户/帖子是否存在
Severity: Major
Found in controller/manage.php - About 3 hrs to fix

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

            getQueueCount: function () {
                var file, i, status, readyFile = 0, files = this.uploader.getFiles();
                for (i = 0; file = files[i++]; ) {
                    status = file.getStatus();
                    if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
    Severity: Major
    Found in static/editor/dialogs/image/image.js and 2 other locations - About 3 hrs to fix
    static/editor/dialogs/attachment/attachment.js on lines 543..550
    static/editor/dialogs/video/video.js on lines 773..780

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

    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

            getQueueCount: function () {
                var file, i, status, readyFile = 0, files = this.uploader.getFiles();
                for (i = 0; file = files[i++]; ) {
                    status = file.getStatus();
                    if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
    Severity: Major
    Found in static/editor/dialogs/video/video.js and 2 other locations - About 3 hrs to fix
    static/editor/dialogs/attachment/attachment.js on lines 543..550
    static/editor/dialogs/image/image.js on lines 758..765

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

    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

            getQueueCount: function () {
                var file, i, status, readyFile = 0, files = this.uploader.getFiles();
                for (i = 0; file = files[i++]; ) {
                    status = file.getStatus();
                    if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
    Severity: Major
    Found in static/editor/dialogs/attachment/attachment.js and 2 other locations - About 3 hrs to fix
    static/editor/dialogs/image/image.js on lines 758..765
    static/editor/dialogs/video/video.js on lines 773..780

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

    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 _Base has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    baidu.flash._Base = (function(){
       
        var prefix = 'bd__flash__';
    
        /**
    Severity: Major
    Found in static/editor/dialogs/wordimage/tangram.js - About 3 hrs to fix

      Function createHTML has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      baidu.swf.createHTML = function (options) {
          options = options || {};
          var version = baidu.swf.version, 
              needVersion = options['ver'] || '6.0.0', 
              vUnit1, vUnit2, i, k, len, item, tmpOpt = {},
      Severity: Minor
      Found in static/editor/dialogs/wordimage/tangram.js - About 3 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

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

      var Lang = {
          "Title_Can_Not_Be_Empty": "Title Can not be empty. ",
          "Title_Too_Long": "Title length can not exceed {{MaxTitleChars}} bytes, current title length is {{Current_Title_Length}} bytes. ",
          "Tags_Empty": "Tags can not be empty. ",
          "Submitting": " Submitting ",
      Severity: Major
      Found in language/en/global.js and 4 other locations - About 3 hrs to fix
      language/pl/global.js on lines 13..34
      language/ru/global.js on lines 13..34
      language/zh-cn/global.js on lines 13..38
      language/zh-tw/global.js on lines 13..34

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

      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

      var Lang = {
          "Title_Can_Not_Be_Empty": "标题不能为空!",
          "Title_Too_Long": "标题长度不能超过{{MaxTitleChars}}字节,当前标题长度为{{Current_Title_Length}}个字节",
          "Tags_Empty": "话题不能为空!",
          "Submitting": " 发表中 ",
      Severity: Major
      Found in language/zh-cn/global.js and 4 other locations - About 3 hrs to fix
      language/en/global.js on lines 13..34
      language/pl/global.js on lines 13..34
      language/ru/global.js on lines 13..34
      language/zh-tw/global.js on lines 13..34

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

      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

      var Lang = {
          "Title_Can_Not_Be_Empty": "Название не может быть пустым. ",
          "Title_Too_Long": "Длина названия не может превышать {{MaxTitleChars}} символов, текущая длина названия {{Current_Title_Length}} символов. ",
          "Tags_Empty": "Тэги не могут быть пустыми. ",
          "Submitting": " Представление ",
      Severity: Major
      Found in language/ru/global.js and 4 other locations - About 3 hrs to fix
      language/en/global.js on lines 13..34
      language/pl/global.js on lines 13..34
      language/zh-cn/global.js on lines 13..38
      language/zh-tw/global.js on lines 13..34

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

      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

      var Lang = {
          "Title_Can_Not_Be_Empty": "標題不能為空!",
          "Title_Too_Long": "標題長度不能超過 {{MaxTitleChars}} 位元組,當前標題長度為 {{Current_Title_Length}} 個位元組",
          "Tags_Empty": "標籤不能為空!",
          "Submitting": " 發佈中 ",
      Severity: Major
      Found in language/zh-tw/global.js and 4 other locations - About 3 hrs to fix
      language/en/global.js on lines 13..34
      language/pl/global.js on lines 13..34
      language/ru/global.js on lines 13..34
      language/zh-cn/global.js on lines 13..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 110.

      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

      var Lang = {
          "Title_Can_Not_Be_Empty": "Tytuł nie może być pusty!",
          "Title_Too_Long": "Określenie to nie może przekroczyć {{MaxTitleChars}} bajtów, długość nagłówka obecnych {{Current_Title_Length}} bajtów",
          "Tags_Empty": "Tematy nie może być pusty!",
          "Submitting": "tabela",
      Severity: Major
      Found in language/pl/global.js and 4 other locations - About 3 hrs to fix
      language/en/global.js on lines 13..34
      language/ru/global.js on lines 13..34
      language/zh-cn/global.js on lines 13..38
      language/zh-tw/global.js on lines 13..34

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

      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 attachAll has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function attachAll($disposition_type, $boundary)
          {
              // Return text of body
              $mime = array();
              $cidUniq = array();
      Severity: Major
      Found in library/PHPMailer.class.php - About 3 hrs to fix

        File background.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        (function () {
        
            var onlineImage,
                backupStyle = editor.queryCommandValue('background');
        
        
        Severity: Minor
        Found in static/editor/dialogs/background/background.js - About 3 hrs to fix

          Function updateLinesNoUndo has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
                      var recomputeMaxLength = false, maxLineLength = maxLine.length;
                      if (!options.lineWrapping)
                          doc.iter(from.line, to.line, function(line) {
                              if (line.text.length == maxLineLength) {recomputeMaxLength = true; return true;}
          Severity: Major
          Found in static/editor/third-party/codemirror/codemirror.js - About 3 hrs to fix

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

                } else if (AllowEmptyTags === false && !$("#SelectTags").html()) {
                    if ($("#AlternativeTag").val().length !== 0) {
                        AddTag($("#AlternativeTag").val(), Math.round(new Date().getTime() / 1000));
                    } else {
                        alert(Lang['Tags_Empty']);
            Severity: Major
            Found in static/js/default/new.function.js and 1 other location - About 3 hrs to fix
            static/js/mobile/topic.function.js on lines 30..78

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

            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