qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Function loadMoreInbox has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function loadMoreInbox(forceToShow) {
    var InboxList = $("#InboxList");
    var InboxPage = $("#InboxPage");
    var InboxLoading = $("#InboxLoading");

Severity: Minor
Found in static/js/default/global.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 _Base has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

baidu.flash._Base = (function(){
   
    var prefix = 'bd__flash__';

    /**
Severity: Minor
Found in static/editor/dialogs/wordimage/tangram.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 ExportDict has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function ExportDict($targetfile)
    {
        if (!$this->mainDicHand) {
            $this->mainDicHand = fopen($this->mainDicFile, 'r');
        }
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 encodeFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function encodeFile($path, $encoding = 'base64')
    {
        try {
            if (!is_readable($path)) {
                throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
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 post_request has a Cognitive Complexity of 10 (exceeds 5 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

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 connect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function connect($host, $port = null, $timeout = 30, $options = array())
    {
        static $streamok;
        //This is enabled by default since 5.0.0 but some providers disable it
        //Check this once and cache the result
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 mb_pathinfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function mb_pathinfo($path, $options = null)
    {
        $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
        $pathinfo = array();
        if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
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 handleKeyBinding has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function handleKeyBinding(e) {
            var name = keyNames[e.keyCode], next = keyMap[options.keyMap].auto, bound, dropShift;
            if (name == null || e.altGraphKey) {
                if (next) options.keyMap = next;
                return null;
Severity: Minor
Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

    Function findPosH has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function findPosH(dir, unit) {
                var end = sel.inverted ? sel.from : sel.to, line = end.line, ch = end.ch;
                var lineObj = getLine(line);
                function findNextLine() {
                    for (var l = line + dir, e = dir < 0 ? -1 : doc.size; l != e; l += dir) {
    Severity: Minor
    Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

      Function getSeriesAndCategories has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getSeriesAndCategories () {
      
          var form = document.forms[ 'data-form' ],
              series = [],
              categories = [],
      Severity: Minor
      Found in static/editor/dialogs/charts/charts.js - About 1 hr to fix

        Function exec has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            RegExp.prototype.exec = function (str) {
                var match, name, r2, origLastIndex;
                if (!this.global)
                    origLastIndex = this.lastIndex;
                match = nativ.exec.apply(this, arguments);
        Severity: Minor
        Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix

          Function parseParams has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function parseParams(str)
              {
                  var match,
                      result = {},
                      arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
          Severity: Minor
          Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix

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

                function Brush()
                {
                    var keywords =    'abstract as base bool break byte case catch char checked class const ' +
                                    'continue decimal default delegate do double else enum event explicit volatile ' +
                                    'extern false finally fixed float for foreach get goto if implicit in int ' +
            Severity: Minor
            Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix

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

                Method upBase64 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function upBase64()
                    {
                        $base64Data = $_POST[$this->fileField];
                        $img        = base64_decode($base64Data);
                        
                Severity: Minor
                Found in library/Uploader.class.php - About 1 hr to fix

                  Function indentLine has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function indentLine(n, how) {
                              if (!how) how = "add";
                              if (how == "smart") {
                                  if (!mode.indent) how = "prev";
                                  else var state = getStateBefore(n);
                  Severity: Minor
                  Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

                    Function quickCodeHandler has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function quickCodeHandler(e)
                        {
                            var target = e.target,
                                highlighterDiv = findParentElement(target, '.syntaxhighlighter'),
                                container = findParentElement(target, '.container'),
                    Severity: Minor
                    Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix

                      Function wrapLinesWithCode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function wrapLinesWithCode(str, css)
                          {
                              if (str == null || str.length == 0 || str == '\n')
                                  return str;
                      
                      
                      Severity: Minor
                      Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix

                        Function setList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                setList: function (list) {
                                    var i, item, p, img, link, _this = this,
                                        listUl = $G('searchListUl');
                        
                                    listUl.innerHTML = '';
                        Severity: Minor
                        Found in static/editor/dialogs/image/image.js - About 1 hr to fix

                          Function processSmartTabs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function processSmartTabs(code, tabSize)
                              {
                                  var lines = splitLines(code),
                                      tab = '\t',
                                      spaces = ''
                          Severity: Minor
                          Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language