qcminecraft/Carbon-Forum-F

View on GitHub

Showing 851 of 851 total issues

Function StartAnalysis has a Cognitive Complexity of 142 (exceeds 5 allowed). Consider refactoring.
Open

    public function StartAnalysis($optimize = true)
    {
        if (!$this->isLoadDic) {
            $this->LoadDict();
        }
Severity: Minor
Found in library/PHPAnalysis.class.php - About 2 days 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 ListDir has a Cognitive Complexity of 134 (exceeds 5 allowed). Consider refactoring.
Open

function ListDir($dir)
{
    global $LanguageList;
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
Severity: Minor
Found in language/auto_translate.php - About 2 days 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 _optimize_result has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring.
Open

    private function _optimize_result(&$smarr, $spos)
    {
        $newarr = array();
        $prePos = $spos - 1;
        $arlen  = count($smarr);
Severity: Minor
Found in library/PHPAnalysis.class.php - About 2 days 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

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

        getImageData: function () {
            var _this = this;

            if(!_this.listEnd && !this.isLoadingData) {
                this.isLoadingData = true;
Severity: Major
Found in static/editor/dialogs/image/image.js and 1 other location - About 2 days to fix
static/editor/dialogs/background/background.js on lines 255..296

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

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

        getImageData: function () {
            var _this = this;

            if(!_this.listEnd && !this.isLoadingData) {
                this.isLoadingData = true;
Severity: Major
Found in static/editor/dialogs/background/background.js and 1 other location - About 2 days to fix
static/editor/dialogs/image/image.js on lines 853..894

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

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 image.js has 964 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * User: Jinqn
 * Date: 14-04-08
 * Time: 下午16:34
 * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片
Severity: Major
Found in static/editor/dialogs/image/image.js - About 2 days to fix

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

                var _this = this,
                    $ = jQuery,    // just in case. Make sure it's not an other libaray.
                    $wrap = _this.$wrap,
                // 图片容器
                    $queue = $wrap.find('.filelist'),
    Severity: Major
    Found in static/editor/dialogs/video/video.js and 1 other location - About 2 days to fix
    static/editor/dialogs/attachment/attachment.js on lines 102..148

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

    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 _this = this,
                    $ = jQuery,    // just in case. Make sure it's not an other libaray.
                    $wrap = _this.$wrap,
                // 图片容器
                    $queue = $wrap.find('.filelist'),
    Severity: Major
    Found in static/editor/dialogs/attachment/attachment.js and 1 other location - About 2 days to fix
    static/editor/dialogs/video/video.js on lines 328..374

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

    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

    function loadMoreMessages(forceToShow) {
        var MessagesList = $("#MessagesList");
        var InboxID = $("#InboxID").val();
        var MessagesPage = $("#MessagesPage");
        var MessagesLoading = $("#MessagesLoading");
    Severity: Major
    Found in static/js/mobile/inbox.js and 1 other location - About 2 days to fix
    static/js/default/global.js on lines 127..158

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

    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

    function loadMoreMessages(forceToShow) {
        var MessagesList = $("#MessagesList");
        var InboxID = $("#InboxID").val();
        var MessagesPage = $("#MessagesPage");
        var MessagesLoading = $("#MessagesLoading");
    Severity: Major
    Found in static/js/default/global.js and 1 other location - About 2 days to fix
    static/js/mobile/inbox.js on lines 16..47

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

    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

            pushData: function (list) {
                var i, item, img, icon, _this = this,
                    urlPrefix = editor.getOpt('imageManagerUrlPrefix');
                for (i = 0; i < list.length; i++) {
                    if(list[i] && list[i].url) {
    Severity: Major
    Found in static/editor/dialogs/image/image.js and 1 other location - About 2 days to fix
    static/editor/dialogs/background/background.js on lines 298..322

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

    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

            pushData: function (list) {
                var i, item, img, icon, _this = this,
                    urlPrefix = editor.getOpt('imageManagerUrlPrefix');
                for (i = 0; i < list.length; i++) {
                    if(list[i] && list[i].url) {
    Severity: Major
    Found in static/editor/dialogs/background/background.js and 1 other location - About 2 days to fix
    static/editor/dialogs/image/image.js on lines 896..920

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            scale: function (img, w, h, type) {
                var ow = img.width,
                    oh = img.height;
    
                if (type == 'justify') {
    Severity: Major
    Found in static/editor/dialogs/image/image.js and 2 other locations - About 2 days to fix
    static/editor/dialogs/attachment/attachment.js on lines 711..736
    static/editor/dialogs/background/background.js on lines 324..349

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            scale: function (img, w, h, type) {
                var ow = img.width,
                    oh = img.height;
    
                if (type == 'justify') {
    Severity: Major
    Found in static/editor/dialogs/attachment/attachment.js and 2 other locations - About 2 days to fix
    static/editor/dialogs/background/background.js on lines 324..349
    static/editor/dialogs/image/image.js on lines 922..947

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            scale: function (img, w, h, type) {
                var ow = img.width,
                    oh = img.height;
    
                if (type == 'justify') {
    Severity: Major
    Found in static/editor/dialogs/background/background.js and 2 other locations - About 2 days to fix
    static/editor/dialogs/attachment/attachment.js on lines 711..736
    static/editor/dialogs/image/image.js on lines 922..947

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

    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 pl.js has 824 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: Major
    Found in language/pl/pl.js - About 1 day to fix

      File en.js has 824 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: Major
      Found in language/en/en.js - About 1 day to fix

        PHPMailer has 101 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PHPMailer
        {
            /**
             * The PHPMailer Version number.
             * @var string
        Severity: Major
        Found in library/PHPMailer.class.php - About 1 day to fix

          File zh-tw.js has 807 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: Major
          Found in language/zh-tw/zh-tw.js - About 1 day to fix

            File zh-cn.js has 807 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: Major
            Found in language/zh-cn/zh-cn.js - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language