Showing 506 of 851 total issues
Method searchCount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function searchCount( $pKeywords, $index='*', $pStart = 0,
$pSize=12, $filter = '', $sort = '' ) {
Method addEmbeddedImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
Function encodeQ
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function encodeQ($str, $position = 'text')
{
// There should not be any EOL in the string
$pattern = '';
$encoded = str_replace(array("\r", "\n"), '', $str);
- 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 Init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function Init($query, $parameters = null)
{
if (!$this->connectionStatus) {
$this->Connect();
}
- 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 GetCookie
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function GetCookie($Key, $DefaultValue = false)
{
global $Config, $IsApp;
if (!$IsApp) {
if (!empty($_COOKIE[$Config['CookiePrefix'] . $Key])) {
- 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
Avoid deeply nested control flow statements. Open
if ($this->IsWord($nfont . $nhead)) {
if (strlen($cw) > 2)
$j++;
$hasDiff = true;
$newarr[$j] = $nfont . $nhead;
Method authenticate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$username,
$password,
$authtype = null,
$realm = '',
$workstation = '',
Method addStringEmbeddedImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$string,
$cid,
$name = '',
$encoding = 'base64',
$type = '',
Function GetImageObjectFromPostField
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function GetImageObjectFromPostField()
{
if (stristr($_FILES[$this->PostField]['type'], "image")) {
$this->ImageSize = getimagesize($_FILES[$this->PostField]['tmp_name']);
if ($this->ImageSize) {
- 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
Avoid deeply nested control flow statements. Open
switch ($file_extension) {
// PHP语言文件翻译
case "php":
$template = __DIR__ . '/language_template.php';
Function GenerateSelect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function GenerateSelect($Options, $Name)
{
global $Config;
if (isset($Config[$Name])) {
$DefaultValue = $Config[$Name];
- 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 upBase64
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function upBase64()
{
$base64Data = $_POST[$this->fileField];
$img = base64_decode($base64Data);
- 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
Consider simplifying this complex logical expression. Open
if (obj) {
var color = obj['background-color'],
repeat = obj['background-repeat'] || 'repeat',
image = obj['background-image'] || '',
position = obj['background-position'] || 'center center',
Consider simplifying this complex logical expression. Open
if ($CurUserExpirationTime > $TimeStamp && $CurUserExpirationTime < ($TimeStamp + 2678400) && $CurUserID && $CurUserCode) {
$TempUserInfo = array();
if ($MCache) {
$TempUserInfo = $MCache->get(MemCachePrefix . 'UserInfo_' . $CurUserID);
}
Consider simplifying this complex logical expression. Open
if (!$SignatureTime || !$SignatureKey || !$SignatureValue || empty($APISignature[$SignatureKey]) || abs($SignatureTime - $TimeStamp) > 600 || !HashEquals($SignatureValue, md5($SignatureKey . $APISignature[$SignatureKey] . $SignatureTime))) {
AlertMsg('403', 'Forbidden', 403);
}
Function load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var load = function (protocol, domains, path, query, cb) {
Function updateLinesNoUndo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
Function clipTo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
clipTo: function(fromOpen, from, toOpen, to, diff) {
Function getHTML
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
getHTML: function(sfrom, sto, includePre, tabText, endAt) {
Function clipTo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
clipTo: function(fromOpen, from, toOpen, to, diff) {