Showing 75 of 125 total issues
Avoid deeply nested control flow statements. Open
Open
else if(self.options.trigger == 'click'){
// use a timeout to prevent immediate closing if the method was called on a click event and if options.delay == 0 (because of bubbling)
setTimeout(function() {
$('body').on('click.'+ self.namespace +' touchstart.'+ self.namespace, function() {
Avoid deeply nested control flow statements. Open
Open
if(self.Status != 'hidden'){
self.$tooltip.fadeTo(self.options.speed, 1);
}
Avoid deeply nested control flow statements. Open
Open
if(self.Status != 'hidden'){
self.$tooltip.removeClass('tooltipster-content-changing');
// after the changing animation has completed, reset the CSS transitions
Function post
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function post()
{
if (! isset($_POST['profile'])) {
throw new Exception("Missing profile data");
}
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function post()
{
$imageUrl = isset($_POST['image_url']) ? $_POST['image_url'] : null;
$subject = isset($_POST['subject']) ? $_POST['subject'] : null;
$body = isset($_POST['body']) ? $_POST['body'] : null;
- 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 too many return
statements within this function. Open
Open
return !this.token.pre && !this.options.pedantic
? this.inline.output(this.token.text)
: this.token.text;
Avoid too many return
statements within this function. Open
Open
return '<p>'
+ this.parseText()
+ '</p>\n';
Avoid too many return
statements within this function. Open
Open
return '<li>'
+ body
+ '</li>\n';
Avoid too many return
statements within this function. Open
Open
return '<blockquote>\n'
+ body
+ '</blockquote>\n';
Avoid too many return
statements within this function. Open
Open
return '<table>\n'
+ body
+ '</table>\n';
Avoid too many return
statements within this function. Open
Open
return '<li>'
+ body
+ '</li>\n';
Avoid too many return
statements within this function. Open
Open
else return this;
Avoid too many return
statements within this function. Open
Open
return '<'
+ type
+ '>\n'
+ body
+ '</'
Avoid too many return
statements within this function. Open
Open
if (multiple) return instances;
Avoid too many return
statements within this function. Open
Open
return '<p>'
+ this.inline.output(this.token.text)
+ '</p>\n';