qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Method searchCount has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function searchCount( $pKeywords, $index='*', $pStart = 0, 
                            $pSize=12, $filter = '', $sort = '' ) {
Severity: Minor
Found in library/SearchClient.class.php - About 45 mins to fix

    Method addEmbeddedImage has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
    Severity: Minor
    Found in library/PHPMailer.class.php - About 45 mins to fix

      Function encodeQ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function encodeQ($str, $position = 'text')
          {
              // There should not be any EOL in the string
              $pattern = '';
              $encoded = str_replace(array("\r", "\n"), '', $str);
      Severity: Minor
      Found in library/PHPMailer.class.php - About 45 mins 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 Init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function Init($query, $parameters = null)
          {
              if (!$this->connectionStatus) {
                  $this->Connect();
              }
      Severity: Minor
      Found in library/PDO.class.php - About 45 mins 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 GetCookie has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function GetCookie($Key, $DefaultValue = false)
      {
          global $Config, $IsApp;
          if (!$IsApp) {
              if (!empty($_COOKIE[$Config['CookiePrefix'] . $Key])) {
      Severity: Minor
      Found in common.php - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                              if ($this->IsWord($nfont . $nhead)) {
                                  if (strlen($cw) > 2)
                                      $j++;
                                  $hasDiff    = true;
                                  $newarr[$j] = $nfont . $nhead;
      Severity: Major
      Found in library/PHPAnalysis.class.php - About 45 mins to fix

        Method authenticate has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $username,
                $password,
                $authtype = null,
                $realm = '',
                $workstation = '',
        Severity: Minor
        Found in library/PHPMailer.smtp.class.php - About 45 mins to fix

          Method addStringEmbeddedImage has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $string,
                  $cid,
                  $name = '',
                  $encoding = 'base64',
                  $type = '',
          Severity: Minor
          Found in library/PHPMailer.class.php - About 45 mins to fix

            Function GetImageObjectFromPostField has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                private function GetImageObjectFromPostField()
                {
                    if (stristr($_FILES[$this->PostField]['type'], "image")) {
                        $this->ImageSize = getimagesize($_FILES[$this->PostField]['tmp_name']);
                        if ($this->ImageSize) {
            Severity: Minor
            Found in library/ImageResize.class.php - About 45 mins 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

            Avoid deeply nested control flow statements.
            Open

                                    switch ($file_extension) {
                                        // PHP语言文件翻译
                                        case "php":
                                            $template = __DIR__ . '/language_template.php';
            
            
            Severity: Major
            Found in language/auto_translate.php - About 45 mins to fix

              Function GenerateSelect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function GenerateSelect($Options, $Name)
              {
                  global $Config;
                  if (isset($Config[$Name])) {
                      $DefaultValue = $Config[$Name];
              Severity: Minor
              Found in view/default/dashboard.php - About 45 mins 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 upBase64 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function upBase64()
                  {
                      $base64Data = $_POST[$this->fileField];
                      $img        = base64_decode($base64Data);
                      
              Severity: Minor
              Found in library/Uploader.class.php - About 45 mins 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

              Consider simplifying this complex logical expression.
              Open

                      if (obj) {
                          var color = obj['background-color'],
                              repeat = obj['background-repeat'] || 'repeat',
                              image = obj['background-image'] || '',
                              position = obj['background-position'] || 'center center',
              Severity: Major
              Found in static/editor/dialogs/background/background.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                if ($CurUserExpirationTime > $TimeStamp && $CurUserExpirationTime < ($TimeStamp + 2678400) && $CurUserID && $CurUserCode) {
                    $TempUserInfo = array();
                    if ($MCache) {
                        $TempUserInfo = $MCache->get(MemCachePrefix . 'UserInfo_' . $CurUserID);
                    }
                Severity: Major
                Found in common.php - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (!$SignatureTime || !$SignatureKey || !$SignatureValue || empty($APISignature[$SignatureKey]) || abs($SignatureTime - $TimeStamp) > 600 || !HashEquals($SignatureValue, md5($SignatureKey . $APISignature[$SignatureKey] . $SignatureTime))) {
                          AlertMsg('403', 'Forbidden', 403);
                      }
                  Severity: Major
                  Found in common.php - About 40 mins to fix

                    Function load has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        var load = function (protocol, domains, path, query, cb) {
                    Severity: Minor
                    Found in static/js/gt.js - About 35 mins to fix

                      Function updateLinesNoUndo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
                      Severity: Minor
                      Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                        Function clipTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                clipTo: function(fromOpen, from, toOpen, to, diff) {
                        Severity: Minor
                        Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                          Function getHTML has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  getHTML: function(sfrom, sto, includePre, tabText, endAt) {
                          Severity: Minor
                          Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix

                            Function clipTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    clipTo: function(fromOpen, from, toOpen, to, diff) {
                            Severity: Minor
                            Found in static/editor/third-party/codemirror/codemirror.js - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language