Showing 506 of 851 total issues
File Uploader.class.php
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by JetBrains PhpStorm.
* User: taoqili
* Date: 12-7-18
Consider simplifying this complex logical expression. Open
if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() {
// CommonJS
if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined')
{
Function createHTML
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
baidu.swf.createHTML = function (options) {
options = options || {};
var version = baidu.swf.version,
needVersion = options['ver'] || '6.0.0',
vUnit1, vUnit2, i, k, len, item, tmpOpt = {},
Method favorite
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function favorite($IsFavorite, $FavoriteType)
{
global $TimeStamp, $CurUserID;
Auth(1);
//$IsFavorite: 检查主题/标签/用户/帖子是否存在
Function _Base
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
baidu.flash._Base = (function(){
var prefix = 'bd__flash__';
/**
Function createHTML
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
baidu.swf.createHTML = function (options) {
options = options || {};
var version = baidu.swf.version,
needVersion = options['ver'] || '6.0.0',
vUnit1, vUnit2, i, k, len, item, tmpOpt = {},
- 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
Method attachAll
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function attachAll($disposition_type, $boundary)
{
// Return text of body
$mime = array();
$cidUniq = array();
File background.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function () {
var onlineImage,
backupStyle = editor.queryCommandValue('background');
Function updateLinesNoUndo
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
var recomputeMaxLength = false, maxLineLength = maxLine.length;
if (!options.lineWrapping)
doc.iter(from.line, to.line, function(line) {
if (line.text.length == maxLineLength) {recomputeMaxLength = true; return true;}
Function parseAddresses
has a Cognitive Complexity of 25 (exceeds 5 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
- 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 cleanNodes
has a Cognitive Complexity of 25 (exceeds 5 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)) {
- 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 Reply
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Reply(UserName, PostFloor, PostID, FormHash, TopicID) {
$.afui.loadContent(
"#Reply",
false,
false,
Function favorite
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function favorite($IsFavorite, $FavoriteType)
{
global $TimeStamp, $CurUserID;
Auth(1);
//$IsFavorite: 检查主题/标签/用户/帖子是否存在
- 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
Method smtpConnect
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function smtpConnect($options = null)
{
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}
Function Toast
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Toast = (function () {
var Toast = function (containerEl, opts) {
if (typeof containerEl === "string" || containerEl instanceof String) {
this.container = document.getElementById(containerEl);
File charts.js
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* 图片转换对话框脚本
**/
var tableData = [],
Function RenderTopic
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function RenderTopic() {
//强制所有链接在新窗口中打开
var AllPosts = document.getElementsByClassName("comment-content");
PostContentLists = {};//Global
AllPosts[AllPosts.length] = document.getElementsByClassName("topic-content")[0];
- 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 AddingNotifications
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function AddingNotifications($Content, $TopicID, $PostID, $FilterUser = '')
{
/*
Type:
1:新回复
- 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 sendmailSend
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function sendmailSend($header, $body)
{
if ($this->Sender != '') {
if ($this->Mailer == 'qmail') {
$sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
- 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 preSend
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function preSend()
{
try {
$this->error_count = 0; // Reset errors
$this->mailHeader = '';
- 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"