qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function CodeMirror has a Cognitive Complexity of 2092 (exceeds 5 allowed). Consider refactoring.
Open

var CodeMirror = (function() {
    // This is the function that produces an editor instance. It's
    // closure is used to store the editor state.
    function CodeMirror(place, givenOptions) {
        // Determine effective options based on given values and defaults.
Severity: Minor
Found in static/editor/third-party/codemirror/codemirror.js - About 1 mo 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 CodeMirror has 2460 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var CodeMirror = (function() {
    // This is the function that produces an editor instance. It's
    // closure is used to store the editor state.
    function CodeMirror(place, givenOptions) {
        // Determine effective options based on given values and defaults.
Severity: Major
Found in static/editor/third-party/codemirror/codemirror.js - About 1 wk to fix

    File codemirror.js has 3205 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // CodeMirror version 2.2
    //
    // All functions that need access to the editor's state live inside
    // the CodeMirror function. Below that, at the bottom of the file,
    // some utilities are defined.
    Severity: Major
    Found in static/editor/third-party/codemirror/codemirror.js - About 1 wk to fix

      Function SyntaxHighlighter has a Cognitive Complexity of 416 (exceeds 5 allowed). Consider refactoring.
      Open

      if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() {
      
      // CommonJS
          if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined')
          {
      Severity: Minor
      Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 wk 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 CodeMirror has 1502 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function CodeMirror(place, givenOptions) {
              // Determine effective options based on given values and defaults.
              var options = {}, defaults = CodeMirror.defaults;
              for (var opt in defaults)
                  if (defaults.hasOwnProperty(opt))
      Severity: Major
      Found in static/editor/third-party/codemirror/codemirror.js - About 1 wk to fix

        File shCore.js has 2373 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // XRegExp 1.5.1
        // (c) 2007-2012 Steven Levithan
        // MIT License
        // <http://xregexp.com>
        // Provides an augmented, extensible, cross-browser implementation of regular expressions,
        Severity: Major
        Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 6 days to fix

          File PHPMailer.class.php has 2263 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * PHPMailer - PHP email creation and transport class.
           * PHP Version 5
           * @package PHPMailer
          Severity: Major
          Found in library/PHPMailer.class.php - About 6 days to fix

            Function SyntaxHighlighter has 966 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() {
            
            // CommonJS
                if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined')
                {
            Severity: Major
            Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 4 days to fix

              File captcha.php has 1346 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              $digit       = 4; //验证码位数
              $digit_width = 55;// 单位验证码宽度
              $height      = 100;// 验证码高度
              $letter_list = str_split("123456789"); // 预设字符,0容易跟O混淆,就不要了,字母和符号也是支持的,汉字支持需要更换字体包。
              Severity: Major
              Found in controller/captcha.php - About 3 days to fix

                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

                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

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

                          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 PHPAnalysis.class.php has 796 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /*
                             * 居于Unicode编码词典的php分词器
                             *  1、只适用于php5,必要函数 iconv
                             *  2、本程序是使用RMM逆向匹配算法进行分词的,词库需要特别编译,本类里提供了 MakeDict() 方法
                            Severity: Major
                            Found in library/PHPAnalysis.class.php - About 1 day to fix

                              Function initUploader has 367 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      initUploader: function () {
                                          var _this = this,
                                              $ = jQuery,    // just in case. Make sure it's not an other libaray.
                                              $wrap = _this.$wrap,
                                          // 图片容器
                              Severity: Major
                              Found in static/editor/dialogs/image/image.js - About 1 day to fix
                                Severity
                                Category
                                Status
                                Source
                                Language