Showing 246 of 804 total issues
Function standard
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
standard: function(response, fields) {
var
html = ''
;
if(response[fields.results] !== undefined) {
Consider simplifying this complex logical expression. Open
Open
if(isShortcutKey) {
var
$currentlySelected = $item.not(selector.unselectable).filter('.' + className.selected).eq(0),
$activeItem = $menu.children('.' + className.active).eq(0),
$selectedItem = ($currentlySelected.length > 0)
Function factory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function factory() {
function init(options,element) {
function chkType() {
if(!element.tagName) {
throw new TypeError('Object is not a valid DOM element');
Function selected
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
selected: function(value, $selectedItem) {
$selectedItem = (settings.allowAdditions)
? $selectedItem || module.get.itemWithAdditions(value)
: $selectedItem || module.get.item(value)
;
Function pushPage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pushPage: function(callback) {
var
transition = module.get.transition(),
$transition = (transition === 'overlay' || module.othersActive())
? $module
Function mockedXHR
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mockedXHR: function () {
var
// xhr does not simulate these properties of xhr but must return them
textStatus = false,
status = false,
Function hideModal
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hideModal: function(callback, keepDimmed) {
callback = $.isFunction(callback)
? callback
: function(){}
;
Function prompt
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prompt: function(identifier, errors) {
var
$field = module.get.field(identifier),
$fieldGroup = $field.closest($group),
$prompt = $fieldGroup.children(selector.prompt),
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async function(callback) {
console.log('Publishing main repo');
await npmPublish({
package: `./package.json`,
Function addDerivedValues
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
addDerivedValues: function(config) {
config = config || extend(false, {}, defaults);
/*--------------
- 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 pullPage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pullPage: function(callback) {
var
transition = module.get.transition(),
$transition = (transition == 'overlay' || module.othersActive())
? $module
Function settings
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
settings: function() {
if($.isPlainObject(parameters)) {
var
keys = Object.keys(parameters),
isLegacySettings = (keys.length > 0)
Function scrollPosition
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scrollPosition: function($item, forceScroll) {
var
edgeTolerance = 5,
$menu,
hasActive,
Function hide
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hide: function(callback) {
callback = $.isFunction(callback)
? callback
: function(){}
;
Function value
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function(addedValue, addedText, $selectedItem) {
var
currentValue = module.get.values(),
newValue
;
Function sizeIFrame
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth) {
function resizeIFrame() {
height = currentHeight;
width = currentWidth;
Function label
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
label: function(value, text, shouldAnimate) {
var
$next = module.is.searchSelection()
? $search
: $text,
Function click
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
click: function(event) {
module.debug('Search result selected');
var
$result = $(this),
$title = $result.find(selector.title).eq(0),
Function refresh
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
refresh: function() {
if(settings.popup) {
$popup = $(settings.popup).eq(0);
}
else {
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show: function(callback) {
callback = $.isFunction(callback)
? callback
: function(){}
;