qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function InitEditor has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function InitEditor() {
    //Initialize editor
    UE.delEditor('editor');
    window.UEDITOR_CONFIG['textarea'] = 'Content';
    window.UEDITOR_CONFIG['elementPathEnabled'] = false;
Severity: Major
Found in static/js/default/topic.function.js - About 3 hrs to fix

    File new.function.js has 295 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/new.function.js - About 3 hrs to fix

      File index.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <meta charset="utf-8">
      
      <?php
      @set_time_limit(0);
      date_default_timezone_set('Asia/Shanghai');
      Severity: Minor
      Found in install/index.php - About 3 hrs to fix

        Method wrapText has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function wrapText($message, $length, $qp_mode = false)
            {
                if ($qp_mode) {
                    $soft_break = sprintf(' =%s', $this->LE);
                } else {
        Severity: Major
        Found in library/PHPMailer.class.php - About 3 hrs to fix

          Function onMouseDown has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function onMouseDown(e) {
                      setShift(e.shiftKey);
                      // Check whether this is a click in a widget
                      for (var n = e_target(e); n != wrapper; n = n.parentNode)
                          if (n.parentNode == code && n != mover) return;
          Severity: Major
          Found in static/editor/third-party/codemirror/codemirror.js - About 3 hrs to fix

            Manage has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Manage
            {
                private $id;
                private $action;
                private $db;
            Severity: Minor
            Found in controller/manage.php - About 3 hrs to fix

              Method AlertMsg has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function AlertMsg($PageTitle, $Error, $StatusCode = 200)
              {
                  global $Lang, $CurProtocol, $RequestURI, $UrlPath, $IsAjax, $IsMobile, $IsApp, $DB, $Config, $HotTagsArray, $CurUserID, $CurUserName, $CurUserCode, $CurUserRole, $CurUserInfo, $FormHash, $StartTime, $PageMetaKeyword, $TemplatePath;
                  $HttpStatuses = [
                      100 => 'Continue',
              Severity: Major
              Found in common.php - About 3 hrs to fix

                Function fileUploader has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                baidu.flash.fileUploader = baidu.flash.fileUploader || function(options){
                    var me = this,
                        options = options || {};
                    
                    options.createOptions = baidu.extend({
                Severity: Major
                Found in static/editor/dialogs/wordimage/tangram.js - About 2 hrs to fix

                  Function AutoTest has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function AutoTest($Method, $View, $URL, $Parameters = [], $ExpectedStatusCode = 200, $Callback = null)
                  {
                      global $APISignature, $Passed, $Failed;
                      $Pass = true;
                      echo "\n\033[33m --------$Method  $URL expect $ExpectedStatusCode-------- \033[0m\n\n";
                  Severity: Minor
                  Found in test.php - About 2 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 Pagination has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function Pagination($PageUrl, $CurrentPage, $TotalPage)
                  {
                      if ($TotalPage <= 1)
                          return false;
                      global $Config, $Lang;
                  Severity: Minor
                  Found in view/default/layout.php - About 2 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 statistics.php has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  if (!defined('InternalAccess')) exit('error: 403 Access Denied');
                  ?>
                  <!-- main-content start -->
                  <script type="text/javascript">
                  Severity: Minor
                  Found in view/default/statistics.php - About 2 hrs to fix

                    Function _addBoardListener has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _addBoardListener:function (saveNum) {
                                var me = this,
                                    margin = 0,
                                    startX = -1,
                                    startY = -1,
                    Severity: Major
                    Found in static/editor/dialogs/scrawl/scrawl.js - About 2 hrs to fix

                      Method createHeader has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function createHeader()
                          {
                              $result = '';
                      
                              if ($this->MessageDate == '') {
                      Severity: Major
                      Found in library/PHPMailer.class.php - About 2 hrs to fix

                        Method preSend has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function preSend()
                            {
                                try {
                                    $this->error_count = 0; // Reset errors
                                    $this->mailHeader = '';
                        Severity: Major
                        Found in library/PHPMailer.class.php - About 2 hrs to fix

                          Function data has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function data($msg_data)
                              {
                                  //This will use the standard timelimit
                                  if (!$this->sendCommand('DATA', 'DATA', 354)) {
                                      return false;
                          Severity: Minor
                          Found in library/PHPMailer.smtp.class.php - About 2 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 FormatTime has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function FormatTime($UnixTimeStamp)
                          {
                              global $Lang;
                              $Seconds = $_SERVER['REQUEST_TIME'] - $UnixTimeStamp;
                              if ($Seconds < 2592000) {
                          Severity: Minor
                          Found in common.php - About 2 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 upFile has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function upFile()
                              {
                                  $file = $this->file = $_FILES[$this->fileField];
                                  if (!$file) {
                                      $this->stateInfo = $this->getStateInfo("ERROR_FILE_NOT_FOUND");
                          Severity: Minor
                          Found in library/Uploader.class.php - About 2 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 checkIdenticalFiles has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function checkIdenticalFiles($tempFileName, $inputType)
                              {
                                  if ($this->DB) {
                                      if ($inputType == 'string') {
                                          $this->fileMD5  = md5($tempFileName);
                          Severity: Minor
                          Found in library/Uploader.class.php - About 2 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 RenderTopic has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function RenderTopic() {
                              //强制所有链接在新窗口中打开
                              var AllPosts = document.getElementsByClassName("comment-content");
                              PostContentLists = {};//Global
                              AllPosts[AllPosts.length] = document.getElementsByClassName("topic-content")[0];
                          Severity: Major
                          Found in static/js/default/topic.function.js - About 2 hrs to fix

                            Method DKIM_Add has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function DKIM_Add($headers_line, $subject, $body)
                                {
                                    $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
                                    $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
                                    $DKIMquery = 'dns/txt'; // Query method
                            Severity: Major
                            Found in library/PHPMailer.class.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language