Showing 4,422 of 4,422 total issues
Function initializeFieldDefinition
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
const initializeFieldDefinition = (
definition: FormKitTypeDefinition,
additionalDefinitionOptions: Pick<
FormKitTypeDefinition,
'props' | 'features'
- 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 onload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reader.onload = (function(_this) {
return function(e) {
var insert;
insert = function(dataUrl, width) {
var img, pos, range, result;
Function onload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reader.onload = function(e) {
var img, insert, result;
result = e.target.result;
img = document.createElement('img');
img.src = result;
Function open
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ZammadChat.prototype.open = function() {
var remainerHeight;
if (this.isOpen) {
this.log.debug('widget already open, block');
return;
Function scrollPosIntoView
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scrollPosIntoView(cm, pos, end, margin) {
if (margin == null) { margin = 0; }
var rect;
if (!cm.options.lineWrapping && pos == end) {
// Set pos and end to the cursor positions around the character pos sticks to
Function maxLengthOk
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Plugin.prototype.maxLengthOk = function(typeAhead) {
if ( !this.options.maxlength ) {
return true
}
var length = this.$element.text().length
Function onMouseDown
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onMouseDown(e) {
var cm = this, display = cm.display;
if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
display.input.ensurePolled();
display.shift = e.shiftKey;
Function objprop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function objprop(type, value) {
if (type == "async") {
cx.marked = "property";
return cont(objprop);
} else if (type == "variable" || cx.style == "keyword") {
Function getDimensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
Function _setOption
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setOption: function( key, value ) {
if ( key === "active" ) {
// _activate() will handle invalid values and update this.options
this._activate( value );
return;
Function top
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
Function style
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
style : function() {
$(this).css({
position : 'fixed',
width : '310px',
height : 'auto',
Function left
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
Method perform
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def perform(customer_id, updated_by_id)
# check if update is needed
customer = User.lookup(id: customer_id)
return if !customer
Function position
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
position: function() {
if ( !this[ 0 ] ) {
return;
}
Function when
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
when: function( singleValue ) {
var
// count of uncompleted subordinates
remaining = arguments.length,
Function clone
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var i, l, srcElements, destElements,
clone = elem.cloneNode( true ),
inPage = isAttached( elem );
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
Function addClass
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
if ( isFunction( value ) ) {
Method search_index_reload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def search_index_reload(silent: false, worker: 0)
tolerance = 10
tolerance_count = 0
query = reorder(created_at: :desc)
total = query.count