Showing 506 of 851 total issues
Function saveRemote
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function saveRemote()
{
$imgUrl = htmlspecialchars($this->fileField);
$imgUrl = str_replace("&", "&", $imgUrl);
- Read upRead up
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 Brush
has 52 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';
Function Brush
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
var funcs = 'abs acos acosh addcslashes addslashes ' +
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
Method _deep_analysis_cn
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _deep_analysis_cn(&$str, $lastec, $spos, $slen, $optimize = true)
{
$quote1 = chr(0x20) . chr(0x1C);
$tmparr = array();
$hasw = 0;
Method AddingNotifications
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AddingNotifications($Content, $TopicID, $PostID, $FilterUser = '')
{
/*
Type:
1:新回复
Method MakeDict
has 49 lines of code (exceeds 25 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');
Function InitNewTopicEditor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function InitNewTopicEditor() {
UE.delEditor('editor');
//Initialize editor
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
window.UEDITOR_CONFIG['textarea'] = 'Content';
- Read upRead up
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 createTab
has a Cognitive Complexity of 15 (exceeds 5 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, //中间数
- Read upRead up
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 cleanAttrValue
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function cleanAttrValue(DOMAttr $domAttr)
{
$attrName = strtolower($domAttr->name);
if ($attrName === 'style' && !empty($this->config->WhiteListStyle)) {
$styles = explode(';', $domAttr->value);
- Read upRead up
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 translate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function translate(&$ChineseLang, &$CurrentLang, &$CompareFlag, $language_name)
{
$diff = array_diff_key($ChineseLang, $CurrentLang);
if (!empty($diff)) {
if ($CompareFlag === false) {
- Read upRead up
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 ReplyToTopic
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ReplyToTopic() {
if (!UE.getEditor('editor').getContent().length) {
alert(Lang['Content_Empty']);
UE.getEditor('editor').focus();
} else {
Method _deep_analysis
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _deep_analysis(&$str, $ctype, $spos, $optimize = true)
{
//中文句子
if ($ctype == 1) {
Method upFile
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function upFile()
{
$file = $this->file = $_FILES[$this->fileField];
if (!$file) {
$this->stateInfo = $this->getStateInfo("ERROR_FILE_NOT_FOUND");
Function callByServer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
baidu.sio.callByServer = /**@function*/function(url, callback, opt_options) {
var scr = document.createElement('SCRIPT'),
prefix = 'bd__cbs__',
callbackName,
callbackImpl,
Function Brush
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
// Contributed by David Simmons-Duffin and Marty Kube
var funcs =
Function jsTokenBase
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function jsTokenBase(stream, state) {
var ch = stream.next();
if (ch == '"' || ch == "'")
return chain(stream, state, jsTokenString(ch));
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
Method __construct
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct($Char, $AvatarSize = 256)
{
$this->Char = strtoupper(mb_substr($Char, 0, 1, "UTF-8"));
$this->AvatarSize = $AvatarSize;
$this->Padding = 30*($this->AvatarSize/256);
Method GetInboxID
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GetInboxID($ReceiverName)
{
global $DB, $CurUserID, $CurUserName, $TimeStamp;
if (empty($CurUserID) || empty($ReceiverName)) {
return 0;
Method smtpSend
has 45 lines of code (exceeds 25 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);
Function ShowNotification
has 44 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);