qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function CreateNewTopic has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function CreateNewTopic() {
    if (!document.NewForm.Title.value.length) {
        CarbonAlert(Lang['Title_Can_Not_Be_Empty']);
        document.NewForm.Title.focus();
        return false;
Severity: Major
Found in static/js/mobile/topic.function.js - About 2 hrs to fix

    Function fileUploader has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    baidu.flash.fileUploader = baidu.flash.fileUploader || function(options){
        var me = this,
            options = options || {};
        
        options.createOptions = baidu.extend({
    Severity: Minor
    Found in static/editor/dialogs/wordimage/tangram.js - 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 ue_callback has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    function ue_callback(url, state) {
        var doc = document,
            picBorard = $G("J_picBoard"),
            img = doc.createElement("img");
    
    
    Severity: Minor
    Found in static/editor/dialogs/scrawl/scrawl.js - 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 exec has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    function exec(scrawlObj) {
        if (scrawlObj.isScrawl) {
            addMaskLayer(lang.scrawlUpLoading);
            var base64 = scrawlObj.getCanvasData();
            if (!!base64) {
    Severity: Minor
    Found in static/editor/dialogs/scrawl/scrawl.js - 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 validateAddress has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function validateAddress($address, $patternselect = null)
        {
            if (is_null($patternselect)) {
                $patternselect = self::$validator;
            }
    Severity: Minor
    Found in library/PHPMailer.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 parseHelloFields has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function parseHelloFields($type)
        {
            $this->server_caps = array();
            $lines = explode("\n", $this->helo_rply);
    
    
    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 smtpSend has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function smtpSend($header, $body)
        {
            $bad_rcpt = array();
            if (!$this->smtpConnect($this->SMTPOptions)) {
                throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
    Severity: Minor
    Found in library/PHPMailer.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

    Method topicAddTag has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function topicAddTag($TopicInfo)
        {
            global $TimeStamp;
            Auth(4, $TopicInfo['UserID'], true);
            $TagName = TagsDiff(array(
    Severity: Major
    Found in controller/manage.php - About 2 hrs to fix

      Method sendmailSend has 56 lines of code (exceeds 25 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: Major
      Found in library/PHPMailer.class.php - About 2 hrs to fix

        Method msgHTML has 56 lines of code (exceeds 25 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: Major
        Found in library/PHPMailer.class.php - About 2 hrs to fix

          File layout.php has 259 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          if (!defined('InternalAccess')) exit('error: 403 Access Denied');
          
          //只有上一页下一页的分页
          function PaginationSimplified($PageUrl, $CurrentPage, $IsLastPage = false)
          Severity: Minor
          Found in view/default/layout.php - About 2 hrs to fix

            Function getHtml has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    getHtml: function(code)
                    {
                        var html = '',
                            classes = [ 'syntaxhighlighter' ],
                            tabSize,
            Severity: Major
            Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 2 hrs to fix

              Function setState has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function setState(val, files) {
              
                              if (val != state) {
              
                                  var stats = uploader.getStats();
              Severity: Major
              Found in static/editor/dialogs/attachment/attachment.js - About 2 hrs to fix

                Function Brush has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function Brush()
                    {
                        function getKeywordsCSS(str)
                        {
                            return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
                Severity: Major
                Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 2 hrs to fix

                  Function setState has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function setState(val, files) {
                  
                                  if (val != state) {
                  
                                      var stats = uploader.getStats();
                  Severity: Major
                  Found in static/editor/dialogs/image/image.js - About 2 hrs to fix

                    Function setState has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                function setState(val, files) {
                    
                                    if (val != state) {
                    
                                        var stats = uploader.getStats();
                    Severity: Major
                    Found in static/editor/dialogs/video/video.js - About 2 hrs to fix

                      File new.php has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      require(LanguagePath . 'new.php');
                      require (LibraryPath . 'Geetestlib.class.php');
                      Auth(1, 0, true);
                      
                      
                      Severity: Minor
                      Found in controller/new.php - About 2 hrs to fix

                        Method CreateMessage has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function CreateMessage($DialogInfo, $Content)
                        {
                            global $DB, $CurUserID, $TimeStamp;
                            if (empty($CurUserID) || empty($DialogInfo) || empty($Content)) {
                                return false;
                        Severity: Major
                        Found in service/inbox.php - About 2 hrs to fix

                          Function CreateNewTopic has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function CreateNewTopic() {
                              if (!document.NewForm.Title.value.length) {
                                  alert(Lang['Title_Can_Not_Be_Empty']);
                                  document.NewForm.Title.focus();
                                  return false;
                          Severity: Minor
                          Found in static/js/default/new.function.js - 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 searchLike has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function searchLike( $pKeywords, $index='*', $pStart = 0, 
                                                      $pSize=12, $filter = '', $sort = '', $columns=array("ID") ) {
                                  self::getSingle();
                                  $sp = self::$sphinx;
                                  empty( $sort ) || $sp->SetSortMode ( SPH_SORT_EXTENDED, $sort );
                          Severity: Minor
                          Found in library/SearchClient.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

                          Severity
                          Category
                          Status
                          Source
                          Language