qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function _deep_analysis has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    private function _deep_analysis(&$str, $ctype, $spos, $optimize = true)
    {
        
        //中文句子
        if ($ctype == 1) {
Severity: Minor
Found in library/PHPAnalysis.class.php - About 5 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 MaterialDesign.Avatars.class.php has 403 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 * Material-Design-Avatars
 * https://github.com/lincanbin/Material-Design-Avatars
 *
Severity: Minor
Found in library/MaterialDesign.Avatars.class.php - About 5 hrs to fix

    Function msgHTML has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        public function msgHTML($message, $basedir = '', $advanced = false)
        {
            preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
            if (array_key_exists(2, $images)) {
                foreach ($images[2] as $imgindex => $url) {
    Severity: Minor
    Found in library/PHPMailer.class.php - About 5 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

    Function authenticate has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        public function authenticate(
            $username,
            $password,
            $authtype = null,
            $realm = '',
    Severity: Minor
    Found in library/PHPMailer.smtp.class.php - About 5 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 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

      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

              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

                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

                      Function InitNewTopicEditor has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function InitNewTopicEditor() {
                          UE.delEditor('editor');
                          //Initialize editor
                          //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
                          window.UEDITOR_CONFIG['textarea'] = 'Content';
                      Severity: Major
                      Found in static/js/default/new.function.js - About 4 hrs to fix

                        Method ListDir has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function ListDir($dir)
                        {
                            global $LanguageList;
                            if (is_dir($dir)) {
                                if ($dh = opendir($dir)) {
                        Severity: Major
                        Found in language/auto_translate.php - About 4 hrs to fix

                          Method _mime_types has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function _mime_types($ext = '')
                              {
                                  $mimes = array(
                                      'xl'    => 'application/excel',
                                      'js'    => 'application/javascript',
                          Severity: Major
                          Found in library/PHPMailer.class.php - About 4 hrs to fix

                            Function stringify has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            baidu.json.stringify = (function () {
                                /**
                                 * 字符串处理时需要转义的字符表
                                 * @private
                                 */
                            Severity: Major
                            Found in static/editor/dialogs/wordimage/tangram.js - About 4 hrs to fix

                              Function createHeader has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function createHeader()
                                  {
                                      $result = '';
                              
                                      if ($this->MessageDate == '') {
                              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

                              Function _deep_analysis_cn has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function _deep_analysis_cn(&$str, $lastec, $spos, $slen, $optimize = true)
                                  {
                                      $quote1 = chr(0x20) . chr(0x1C);
                                      $tmparr = array();
                                      $hasw   = 0;
                              Severity: Minor
                              Found in library/PHPAnalysis.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

                              Severity
                              Category
                              Status
                              Source
                              Language