Showing 506 of 851 total issues
Method validateAddress
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function validateAddress($address, $patternselect = null)
{
if (is_null($patternselect)) {
$patternselect = self::$validator;
}
Method saveRemote
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function saveRemote()
{
$imgUrl = htmlspecialchars($this->fileField);
$imgUrl = str_replace("&", "&", $imgUrl);
PhpAnalysis
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class PhpAnalysis
{
//hash算法选项
public $mask_value = 0x000F; //Default:0xFFFF
Function getHTML
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
getHTML: function(sfrom, sto, includePre, tabText, endAt) {
var html = [], first = true;
if (includePre)
html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");
function span(text, style) {
Method connect
has 65 lines of code (exceeds 25 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
Function GetTags
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function GetTags() {
var CurrentContentHash = md5(document.NewForm.Title.value + document.NewForm.Content.value);
//取Title与Content 联合Hash值,与之前input的内容比较,不同则开始获取话题,随后保存进hidden input。
if (CurrentContentHash != document.NewForm.ContentHash.value) {
if (document.NewForm.Title.value.length || document.NewForm.Content.value.length) {
- 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 GetTags
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function GetTags() {
var CurrentContentHash = md5(document.NewForm.Title.value + UE.getEditor('editor').getContentTxt());
//取Title与Content 联合Hash值,与之前input的内容比较,不同则开始获取话题,随后保存进hidden input。
if (CurrentContentHash !== document.NewForm.ContentHash.value) {
if (document.NewForm.Title.value.length || UE.getEditor('editor').getContentTxt().length) {
- 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 AutoTest
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AutoTest($Method, $View, $URL, $Parameters = [], $ExpectedStatusCode = 200, $Callback = null)
{
global $APISignature, $Passed, $Failed;
$Pass = true;
echo "\n\033[33m --------$Method $URL expect $ExpectedStatusCode-------- \033[0m\n\n";
Function HtmlScript
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
sh.HtmlScript = function(scriptBrushName)
{
var brushClass = findBrush(scriptBrushName),
scriptBrush,
xmlBrush = new sh.brushes.Xml(),
Function replace
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
String.prototype.replace = function (search, replacement) {
var isRegex = XRegExp.isRegExp(search),
captureNames, result, str, origLastIndex;
// There are too many combinations of search/replacement types/values and browser bugs that
Function Brush
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
// Contributed by Jen
// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
Function loadMoreMessages
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function loadMoreMessages(forceToShow) {
var MessagesList = $("#MessagesList");
var InboxID = $("#InboxID").val();
var MessagesPage = $("#MessagesPage");
var MessagesLoading = $("#MessagesLoading");
- 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 loadMoreMessages
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function loadMoreMessages(forceToShow) {
var MessagesList = $("#MessagesList");
var InboxID = $("#InboxID").val();
var MessagesPage = $("#MessagesPage");
var MessagesLoading = $("#MessagesLoading");
- 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 _sort_finally_result
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function _sort_finally_result()
{
$newarr = array();
$i = 0;
foreach ($this->simpleResult as $k => $v) {
- 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 CreateNewTopic
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CreateNewTopic() {
if (!document.NewForm.Title.value.length) {
alert(Lang['Title_Can_Not_Be_Empty']);
document.NewForm.Title.focus();
return false;
Function updateDisplay
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateDisplay(changes, suppressCallback) {
if (!scroller.clientWidth) {
showingFrom = showingTo = displayOffset = 0;
return;
}
Consider simplifying this complex logical expression. Open
D("",b,a);b=d("pjax:error",[b,c,e,a]);"GET"==a.type&&"abort"!==c&&b&&u(f.url)};a.success=function(e,m,k){var n=f.state,p="function"===typeof b.pjax.defaults.version?b.pjax.defaults.version():b.pjax.defaults.version,l=k.getResponseHeader("X-PJAX-Version"),g=D(e,k,a),q=t(g.url);c&&(q.hash=c,g.url=q.href);if(p&&l&&p!==l)u(g.url);else if(g.contents){f.state={id:a.id||(new Date).getTime(),url:g.url,title:g.title,container:h.selector,fragment:a.fragment,timeout:a.timeout};(a.push||a.replace)&&window.history.replaceState(f.state,
g.title,g.url);if(b.contains(a.container,document.activeElement))try{document.activeElement.blur()}catch(r){}g.title&&(document.title=g.title);d("pjax:beforeReplace",[g.contents,a],{state:f.state,previousState:n});h.html(g.contents);(n=h.find("input[autofocus], textarea[autofocus]").last()[0])&&document.activeElement!==n&&n.focus();L(g.scripts);g=a.scrollTo;c&&(n=decodeURIComponent(c.slice(1)),n=document.getElementById(n)||document.getElementsByName(n)[0])&&(g=b(n).offset().top);"number"==typeof g&&
b(window).scrollTop(g);d("pjax:success",[e,m,k,a])}else u(g.url)};f.state||(f.state={id:(new Date).getTime(),url:window.location.href,title:document.title,container:h.selector,fragment:a.fragment,timeout:a.timeout},window.history.replaceState(f.state,document.title));E(f.xhr);f.options=a;var m=f.xhr=b.ajax(a);0<m.readyState&&(a.push&&!a.replace&&(M(f.state.id,F(h)),window.history.pushState(null,"",a.requestUrl)),d("pjax:start",[m,a]),d("pjax:send",[m,a]));return f.xhr}function N(a,d){return f(b.extend({url:window.location.href,
Consider simplifying this complex logical expression. Open
(function(b){function J(a,d,e){var c=this;return this.on("click.pjax",a,function(a){var f=b.extend({},l(d,e));f.container||(f.container=b(this).attr("data-pjax")||c);A(a,f)})}function A(a,d,e){e=l(d,e);d=a.currentTarget;if("A"!==d.tagName.toUpperCase())throw"$.fn.pjax or $.pjax.click requires an anchor element";if(!(1<a.which||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||location.protocol!==d.protocol||location.hostname!==d.hostname||-1<d.href.indexOf("#")&&d.href.replace(/#.*/,"")==location.href.replace(/#.*/,
"")||a.isDefaultPrevented())){var c={url:d.href,container:b(d).attr("data-pjax"),target:d};e=b.extend({},c,e);c=b.Event("pjax:click");b(d).trigger(c,[e]);c.isDefaultPrevented()||(f(e),a.preventDefault(),b(d).trigger("pjax:clicked",[e]))}}function K(a,d,e){e=l(d,e);d=a.currentTarget;var c=b(d);if("FORM"!==d.tagName.toUpperCase())throw"$.pjax.submit requires a form element";c={type:(c.attr("method")||"GET").toUpperCase(),url:c.attr("action"),container:c.attr("data-pjax"),target:d};if("GET"!==c.type&&
Function Brush
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
// Copyright 2006 Shin, YoungJin
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
File gt.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* initGeetest 1.0.0
* 用于加载id对应的验证码库,并支持宕机模式
* 暴露 initGeetest 进行验证码的初始化
* 一般不需要用户进行修改
*/