qcminecraft/Carbon-Forum-F

View on GitHub

Showing 506 of 851 total issues

Method postEdit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function postEdit($PostInfo)
    {
        global $CurUserRole, $CurUserName, $TimeStamp;
        if ($this->config['AllowEditing'] === 'true') {
            Auth(4, $PostInfo['UserID'], true);
Severity: Minor
Found in controller/manage.php - About 1 hr to fix

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

        function initColorSelector () {
            var obj = editor.queryCommandValue('background');
            if (obj) {
                var color = obj['background-color'],
                    repeat = obj['background-repeat'] || 'repeat',
    Severity: Minor
    Found in static/editor/dialogs/background/background.js - About 1 hr to fix

      Method getManageInfo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getManageInfo($manageType)
          {
              global $CurUserID;
              switch ($manageType) {
                  case 'topic':
      Severity: Minor
      Found in controller/manage.php - About 1 hr to fix

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

            function Brush()
            {
                // Contributed by Joel 'Jaykul' Bennett, http://PoshCode.org | http://HuddledMasses.org
                var keywords =    'while validateset validaterange validatepattern validatelength validatecount ' +
                                'until trap switch return ref process param parameter in if global: '+
        Severity: Minor
        Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                      if(data['url']) {
                          return [{
                              src: data['url'],
                              _src: data['url'],
                              width: data['width'] || '',
          Severity: Critical
          Found in static/editor/dialogs/image/image.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                            if (($cn > 0x3FFF && $cn < 0x9FA6) || ($cn > 0xF8FF && $cn < 0xFA2D) || ($cn > 0xABFF && $cn < 0xD7A4) || ($cn > 0x3040 && $cn < 0x312B)) {
                                if ($lastc != 1 && $onstr != '') {
                                    $this->simpleResult[$s]['w'] = $onstr;
                                    if ($lastc == 2) {
                                        if (!preg_match('/' . $notNumberMatch . '/i', iconv(UCS2, 'utf-8', $onstr)))
            Severity: Critical
            Found in library/PHPAnalysis.class.php - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

              if (function_exists('imagecreate') && function_exists('imagecolorset') && function_exists('imagecopyresized') && function_exists('imagecolorallocate') && function_exists('imagesetpixel') && function_exists('imagechar') && function_exists('imagecreatefromgif') && function_exists('imagepng')) {
                  
                  $im              = imagecreate($width, $height);
                  $backgroundcolor = imagecolorallocate($im, 255, 255, 255);
                  
              Severity: Critical
              Found in seccode.php - About 1 hr to fix

                Function initButtons has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function initButtons() {
                
                        dialog.onok = function () {
                            var remote = false, list = [], id, tabs = $G('tabhead').children;
                            for (var i = 0; i < tabs.length; i++) {
                Severity: Minor
                Found in static/editor/dialogs/image/image.js - About 1 hr to fix

                  Method CheckOpenID has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function CheckOpenID()
                  {
                      global $DB, $AppID, $OauthObject, $TimeStamp, $Config, $CurUserID, $Lang;
                      $OauthUserID = $DB->single("SELECT UserID FROM " . PREFIX . "app_users 
                          WHERE AppID=:AppID AND OpenID = :OpenID", array(
                  Severity: Minor
                  Found in controller/oauth.php - About 1 hr to fix

                    Function callByBrowser has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    baidu.sio.callByBrowser = function (url, opt_callback, opt_options) {
                        var scr = document.createElement("SCRIPT"),
                            scriptLoaded = 0,
                            options = opt_options || {},
                            charset = options['charset'],
                    Severity: Minor
                    Found in static/editor/dialogs/wordimage/tangram.js - About 1 hr to fix

                      Function setSelection has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function setSelection(from, to, oldFrom, oldTo) {
                                  goalColumn = null;
                                  if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;}
                                  if (posEq(sel.from, from) && posEq(sel.to, to)) return;
                                  if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}
                      Severity: Minor
                      Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

                        Function jsonp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var jsonp = function (domains, path, config, callback) {
                                if (isObject(config.getLib)) {
                                    config._extend(config.getLib);
                                    callback(config);
                                    return;
                        Severity: Minor
                        Found in static/js/gt.js - About 1 hr to fix

                          Function onContextMenu has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function onContextMenu(e) {
                                      var pos = posFromMouse(e);
                                      if (!pos || window.opera) return; // Opera is difficult.
                                      if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))
                                          operation(setCursor)(pos.line, pos.ch);
                          Severity: Minor
                          Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

                            Method cleanNodes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function cleanNodes(DOMElement $elem, $isFirstNode = false)
                                {
                                    $nodeName = strtolower($elem->nodeName);
                                    $textContent = $elem->textContent;
                                    if ($isFirstNode || array_key_exists($nodeName, $this->config->WhiteListTag)) {
                            Severity: Minor
                            Found in library/WhiteHTMLFilter.php - About 1 hr to fix

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

                                Function getSeriesAndCategories has a Cognitive Complexity of 11 (exceeds 5 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

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

                                function CurIP()
                                {
                                    $IsCDN = false; //未使用CDN时,应直接使用 $_SERVER['REMOTE_ADDR'] 以防止客户端伪造IP
                                    $IP = false;
                                    if (!empty($_SERVER["HTTP_CLIENT_IP"])) {
                                Severity: Minor
                                Found in common.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 MakeDict has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function MakeDict($source_file, $target_file = '')
                                    {
                                        $target_file = ($target_file == '' ? $this->mainDicFile : $target_file);
                                        $allk        = array();
                                        $fp          = fopen($source_file, '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 coordsChar has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function coordsChar(x, y) {
                                            if (y < 0) y = 0;
                                            var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);
                                            var lineNo = lineAtHeight(doc, heightPos);
                                            if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};
                                Severity: Minor
                                Found in static/editor/third-party/codemirror/codemirror.js - About 1 hr to fix

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

                                      function Brush()
                                      {
                                          function process(match, regexInfo)
                                          {
                                              var constructor = SyntaxHighlighter.Match,
                                  Severity: Minor
                                  Found in static/editor/third-party/SyntaxHighlighter/shCore.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language