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");
- 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 _Base
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
baidu.flash._Base = (function(){
var prefix = 'bd__flash__';
/**
- 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 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');
}
- 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 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);
- 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 post_request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function post_request($url, $postdata = '') {
if (!$postdata) {
return 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 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
- 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 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)) {
- 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 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;
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) {
Function getSeriesAndCategories
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSeriesAndCategories () {
var form = document.forms[ 'data-form' ],
series = [],
categories = [],
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);
Function parseParams
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseParams(str)
{
var match,
result = {},
arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
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 ' +
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) {
Method upBase64
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function upBase64()
{
$base64Data = $_POST[$this->fileField];
$img = base64_decode($base64Data);
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);
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'),
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;
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 = '';
Function processSmartTabs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processSmartTabs(code, tabSize)
{
var lines = splitLines(code),
tab = '\t',
spaces = ''