Showing 476 of 1,049 total issues
Function fillHours
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fillHours = function () {
pMoment.lang(picker.options.language);
var table = picker.widget.find('.timepicker .timepicker-hours table'), html = '', current, i, j;
table.parent().hide();
if (picker.use24hours) {
Function offset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
offset: function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
Function insertLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function insertLink() {
var linkAttrs = {
href: href,
target: data.target ? data.target : null,
rel: data.rel ? data.rel : null,
Function save
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function save() {
var formObj;
formObj = tinymce.DOM.getParent(editor.id, 'form');
Function cellSelectionHandler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cellSelectionHandler(e) {
var sel, table, target = e.target;
if (resizing) {
return;
Function pasteImageData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function pasteImageData(e, rng) {
var dataTransfer = e.clipboardData || e.dataTransfer;
function processItems(items) {
var i, item, reader;
Function keydown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, keydown: function (e) {
var $this
, $items
, $active
, $parent
Function keydown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, keydown: function (e) {
var $this
, $items
, $active
, $parent
Function restoreEndPoint
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function restoreEndPoint(start) {
var container, offset, node;
function nodeIndex(container) {
var node = container.parentNode.firstChild, idx = 0;
Function parse_flags
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse_flags(flags, options) {
var ret = {
theme: settings.themes.gray
}, render = false;
Function end
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
end: function(name) {
if (name == "video" && updateAll) {
for (var index = 1; index <= 2; index++) {
if (data["source" + index]) {
var attrs = [];
Function cleanup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cleanup() {
var rng = dom.createRng(), row;
// Empty rows
each(dom.select('tr', table), function(tr) {
Function keydown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, keydown: function (e) {
var $this
, $items
, $active
, $parent
Consider simplifying this complex logical expression. Open
Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
Consider simplifying this complex logical expression. Open
Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
Consider simplifying this complex logical expression. Open
Open
if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 &&
(last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) &&
last.previousSibling && last.previousSibling.nodeName == "TABLE") {
editor.dom.remove(last);
}
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function render()
{
if ($this->getDisplayField() === null) {
throw new \InvalidArgumentException(sprintf('Please provide a display field for the `%s` relation via the display(); method.', $this->getName()));
}
- 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 access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Avoid deeply nested control flow statements. Open
Open
if ( conv && s[ "throws" ] ) {
response = conv( response );
} else {
try {
response = conv( response );