qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

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

<?php
/**
 * Created by JetBrains PhpStorm.
 * User: taoqili
 * Date: 12-7-18
Severity: Minor
Found in library/Uploader.class.php - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

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

      Function createHTML has 99 lines of code (exceeds 25 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: Major
      Found in static/editor/dialogs/wordimage/tangram.js - About 3 hrs to fix

        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

          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

            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

                  Function parseAddresses has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function parseAddresses($addrstr, $useimap = true)
                      {
                          $addresses = array();
                          if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
                              //Use this built-in parser if it's available
                  Severity: Minor
                  Found in library/PHPMailer.class.php - 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

                  Function cleanNodes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function cleanNodes(DOMElement $elem, $isFirstNode = false)
                      {
                          $nodeName = strtolower($elem->nodeName);
                          $textContent = $elem->textContent;
                          if ($isFirstNode || array_key_exists($nodeName, $this->config->WhiteListTag)) {
                  Severity: Minor
                  Found in library/WhiteHTMLFilter.php - 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

                  Function Reply has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Reply(UserName, PostFloor, PostID, FormHash, TopicID) {
                      $.afui.loadContent(
                          "#Reply", 
                          false, 
                          false, 
                  Severity: Major
                  Found in static/js/mobile/global.js - About 3 hrs to fix

                    Function favorite has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function favorite($IsFavorite, $FavoriteType)
                        {
                            global $TimeStamp, $CurUserID;
                            Auth(1);
                            //$IsFavorite: 检查主题/标签/用户/帖子是否存在
                    Severity: Minor
                    Found in controller/manage.php - 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

                    Method smtpConnect has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function smtpConnect($options = null)
                        {
                            if (is_null($this->smtp)) {
                                $this->smtp = $this->getSMTPInstance();
                            }
                    Severity: Major
                    Found in library/PHPMailer.class.php - About 3 hrs to fix

                      Function Toast has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var Toast = (function () {
                              var Toast = function (containerEl, opts) {
                      
                                  if (typeof containerEl === "string" || containerEl instanceof String) {
                                      this.container = document.getElementById(containerEl);
                      Severity: Major
                      Found in static/js/mobile/global.js - About 3 hrs to fix

                        File charts.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /*
                         * 图片转换对话框脚本
                         **/
                        
                        var tableData = [],
                        Severity: Minor
                        Found in static/editor/dialogs/charts/charts.js - About 3 hrs to fix

                          Function RenderTopic has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function RenderTopic() {
                              //强制所有链接在新窗口中打开
                              var AllPosts = document.getElementsByClassName("comment-content");
                              PostContentLists = {};//Global
                              AllPosts[AllPosts.length] = document.getElementsByClassName("topic-content")[0];
                          Severity: Minor
                          Found in static/js/default/topic.function.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

                          Function AddingNotifications has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function AddingNotifications($Content, $TopicID, $PostID, $FilterUser = '')
                          {
                              /*
                              Type:
                              1:新回复
                          Severity: Minor
                          Found in common.php - 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

                          Function sendmailSend has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function sendmailSend($header, $body)
                              {
                                  if ($this->Sender != '') {
                                      if ($this->Mailer == 'qmail') {
                                          $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
                          Severity: Minor
                          Found in library/PHPMailer.class.php - 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

                          Function preSend has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function preSend()
                              {
                                  try {
                                      $this->error_count = 0; // Reset errors
                                      $this->mailHeader = '';
                          Severity: Minor
                          Found in library/PHPMailer.class.php - 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

                          Severity
                          Category
                          Status
                          Source
                          Language