qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function highlightWorker has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function highlightWorker() {
            var end = +new Date + options.workTime;
            var foundWork = work.length;
            while (work.length) {
                if (!getLine(showingFrom).stateAfter) var task = showingFrom;
Severity: Minor
Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

    Function getFileData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function CreateNewTopic has a Cognitive Complexity of 12 (exceeds 5 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: Minor
      Found in static/js/mobile/topic.function.js - 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 topicAddTag has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function topicAddTag($TopicInfo)
          {
              global $TimeStamp;
              Auth(4, $TopicInfo['UserID'], true);
              $TagName = TagsDiff(array(
      Severity: Minor
      Found in controller/manage.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 renderTable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      function renderTable ( table ) {
      
          var tableHtml = [];
      
          //构造数据
      Severity: Minor
      Found in static/editor/dialogs/charts/charts.js - 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 setError has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function setError($msg)
          {
              $this->error_count++;
              if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
                  $lasterror = $this->smtp->getError();
      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 GetFinallyKeywords has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function GetFinallyKeywords($num = 10)
          {
              $n     = 0;
              $arr   = $this->GetFinallyIndex();
              $okstr = '';
      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 GetFinallyIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function GetFinallyIndex()
          {
              $rearr = array();
              foreach ($this->finallyResult as $v) {
                  if ($this->resultType == 2 && ($v['t'] == 3 || $v['t'] == 5)) {
      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 addAnAddress has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addAnAddress($kind, $address, $name = '')
          {
              if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) {
                  $error_message = $this->lang('Invalid recipient kind: ') . $kind;
                  $this->setError($error_message);
      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 fromTextArea has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          CodeMirror.fromTextArea = function(textarea, options) {
              if (!options) options = {};
              options.value = textarea.value;
              if (!options.tabindex && textarea.tabindex)
                  options.tabindex = textarea.tabindex;
      Severity: Minor
      Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

        Function matchBrackets has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function matchBrackets(autoclear) {
                    var head = sel.inverted ? sel.from : sel.to, line = getLine(head.line), pos = head.ch - 1;
                    var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
                    if (!match) return;
                    var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles;
        Severity: Minor
        Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

          Function initEvents has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  initEvents: function(){
                      var _this = this;
          
                      /* 点击搜索按钮 */
                      domUtils.on($G('searchBtn'), 'click', function(){
          Severity: Minor
          Found in static/editor/dialogs/image/image.js - About 1 hr to fix

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

              Function createTab has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createTab( tabName ) {
                  var faceVersion = "?v=1.1", //版本号
                          tab = $G( tabName ), //获取将要生成的Div句柄
                          imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径
                          positionLine = 11 / 2, //中间数
              Severity: Minor
              Found in static/editor/dialogs/emotion/emotion.js - About 1 hr to fix

                Method setLanguage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function setLanguage($langcode = 'en', $lang_path = '')
                    {
                        // Define full set of translatable strings in English
                        $PHPMAILER_LANG = array(
                            'authenticate' => 'SMTP Error: Could not authenticate.',
                Severity: Minor
                Found in library/PHPMailer.class.php - About 1 hr to fix

                  Method get_lines has 35 lines of code (exceeds 25 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

                    Function upload has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        $.upload = function(options) {
                            var opts = $.extend(jQuery.uploadDefault, options);
                            if (opts.url === '') {
                                return;
                            }
                    Severity: Minor
                    Found in static/js/jquery.async.uploader.js - About 1 hr to fix

                      Function onDrop has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function onDrop(e) {
                                  e.preventDefault();
                                  var pos = posFromMouse(e, true), files = e.dataTransfer.files;
                                  if (!pos || options.readOnly) return;
                                  if (files && files.length && window.FileReader && window.File) {
                      Severity: Minor
                      Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

                        Function createTab has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        (function createTab(content) {
                            for (var i = 0, ci; ci = content[i++];) {
                                var span = document.createElement("span");
                                span.setAttribute("tabSrc", ci.name);
                                span.innerHTML = ci.title;
                        Severity: Minor
                        Found in static/editor/dialogs/spechars/spechars.js - About 1 hr to fix

                          Function split has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              String.prototype.split = function (s /* separator */, limit) {
                                  // If separator `s` is not a regex, use the native `split`
                                  if (!XRegExp.isRegExp(s))
                                      return nativ.split.apply(this, arguments);
                          
                          
                          Severity: Minor
                          Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language