Showing 8 of 10 total issues
Function factory
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
Open
}(function factory($) {
/**
* Modifies an address field for this wrapped set of fields, given a config
* representing how the country writes its addresses (conforming roughly to
* xNAL standards), and an array of fields you desire to show (again, roughly
- 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 factory
has 250 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}(function factory($) {
/**
* Modifies an address field for this wrapped set of fields, given a config
* representing how the country writes its addresses (conforming roughly to
* xNAL standards), and an array of fields you desire to show (again, roughly
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
File jquery.addressfield.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Address field
* https://github.com/tableau-mkt/jquery.addressfield
*
* Licensed under the MIT license.
Function apply
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.addressfield.apply = function (config, fieldMap) {
var $container = $(this),
fieldOrder = [],
$element,
selector,
Function addressfield
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.addressfield = function(options) {
var $container = this,
configs = $.extend({
fields: {},
json: null,
Avoid deeply nested control flow statements. Open
Open
if (!$element.is('select')) {
$element = $.fn.addressfield.convertToSelect.call($element);
}
Avoid deeply nested control flow statements. Open
Open
if ($element.is('select')) {
$element = $.fn.addressfield.convertToText.call($element);
}