qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function LoadDict has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function LoadDict($maindic = '')
    {
        $startt   = microtime(true);
        //正常读取文件
        $dicAddon = $this->addonDicFile;
Severity: Minor
Found in library/PHPAnalysis.class.php - About 1 hr 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 addOrEnqueueAnAddress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addOrEnqueueAnAddress($kind, $address, $name)
    {
        $address = trim($address);
        $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
        if (($pos = strrpos($address, '@')) === false) {
Severity: Minor
Found in library/PHPMailer.class.php - About 1 hr 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 get_lines has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_lines()
    {
        // If the connection is bad, give up straight away
        if (!is_resource($this->smtp_conn)) {
            return '';
Severity: Minor
Found in library/PHPMailer.smtp.class.php - About 1 hr 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 getMailMIME has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMailMIME()
    {
        $result = '';
        $ismultipart = true;
        switch ($this->message_type) {
Severity: Minor
Found in library/PHPMailer.class.php - About 1 hr 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 utf8CharBoundary has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function utf8CharBoundary($encodedText, $maxLength)
    {
        $foundSplitPos = false;
        $lookBack = 3;
        while (!$foundSplitPos) {
Severity: Minor
Found in library/PHPMailer.class.php - About 1 hr 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 getImageData has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getImageData: function () {
            var _this = this;

            if(!_this.listEnd && !this.isLoadingData) {
                this.isLoadingData = true;
Severity: Minor
Found in static/editor/dialogs/image/image.js - About 1 hr to fix

    Function getImageData has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            getImageData: function () {
                var _this = this;
    
                if(!_this.listEnd && !this.isLoadingData) {
                    this.isLoadingData = true;
    Severity: Minor
    Found in static/editor/dialogs/background/background.js - About 1 hr to fix

      Function init has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              init:function () {
                  var colorPiker = new UE.ui.ColorPicker({
                          editor:editor
                      }),
                      colorPop = new UE.ui.Popup({
      Severity: Minor
      Found in static/editor/dialogs/table/edittable.js - About 1 hr to fix

        Function ShowNotification has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ShowNotification(NewMessageNumber) {
            if (NewMessageNumber > 0) {
                document.title = '(' + Lang['New_Message'].replace('{{NewMessage}}', NewMessageNumber) + ')' + document.title.replace(new RegExp(('\\(' + Lang['New_Message'] + '\\)').replace('{{NewMessage}}', '\\d+'), "g"), '');
                $("#MessageNumber").css("visibility", "visible");
                $("#MessageNumber").html(NewMessageNumber);
        Severity: Minor
        Found in static/js/default/global.js - About 1 hr to fix

          Function pushData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  pushData: function (list) {
                      var i, item, img, filetype, preview, icon, _this = this,
                          urlPrefix = editor.getOpt('fileManagerUrlPrefix');
                      for (i = 0; i < list.length; i++) {
                          if(list[i] && list[i].url) {
          Severity: Minor
          Found in static/editor/dialogs/attachment/attachment.js - About 1 hr to fix

            Function _renderTemplate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _renderTemplate:function (data) {
                        var me = this;
                        if (data.length == 0)return '<div class="empty">' + lang.emptyTxt + '</div>';
                        data = me._rebuildData(data);
                        var s = [], p = [], t = [];
            Severity: Minor
            Found in static/editor/dialogs/music/music.js - About 1 hr to fix

              Function exec has 38 lines of code (exceeds 25 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 1 hr to fix

                Method XssEscape has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function XssEscape($html)
                {
                    $filter = new WhiteHTMLFilter();
                    $urlFilter = function($url) {
                        $token = parse_url($url);
                Severity: Minor
                Found in common.php - About 1 hr to fix

                  Method checkIdenticalFiles has 38 lines of code (exceeds 25 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 1 hr to fix

                    Function patchDisplay has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function patchDisplay(from, to, intact) {
                                // The first pass removes the DOM nodes that aren't intact.
                                if (!intact.length) lineDiv.innerHTML = "";
                                else {
                                    function killNode(node) {
                    Severity: Minor
                    Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

                      Function tokenBase has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function tokenBase(stream, state) {
                              var ch = stream.next();
                              if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());}
                              else if (ch == "/" && stream.eat("*")) {
                                  state.tokenize = tokenCComment;
                      Severity: Minor
                      Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

                        Method getMailMIME has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getMailMIME()
                            {
                                $result = '';
                                $ismultipart = true;
                                switch ($this->message_type) {
                        Severity: Minor
                        Found in library/PHPMailer.class.php - About 1 hr to fix

                          Method parseAddresses has 37 lines of code (exceeds 25 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 1 hr to fix

                            Method post_request has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function post_request($url, $postdata = '') {
                                    if (!$postdata) {
                                        return false;
                                    }
                            
                            
                            Severity: Minor
                            Found in library/Geetestlib.class.php - About 1 hr to fix

                              Method Pagination has 37 lines of code (exceeds 25 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 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language