Showing 10 of 10 total issues
Function ngIpAddress
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ngIpAddress() {
return {
restrict: 'A',
require: '?ngModel',
scope: {
Function link
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs, ngModelCtrl) {
if (!ngModelCtrl) {
return;
}
Function ngIpAddress
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ngIpAddress() {
return {
restrict: 'A',
require: '?ngModel',
link: function(scope, element, attrs, ngModelCtrl) {
Function link
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs, ngModelCtrl) {
if (!ngModelCtrl) {
return;
}
Consider simplifying this complex logical expression. Open
Open
if ((event.which < 46 && event.which !== 0 && event.which !== 8 && event.which !== 13)
|| event.which === 47
|| (event.which === 58 && !allowPort)
|| event.which > 58 && !(ctrlDown && (event.which === 99 || event.which === 118 || event.which === 120))) {
// Stop key press from propagating
Function evalInput
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function evalInput(val) {
// If val is falsey (undefined, empty string, etc)...
if (!val) {
// Set the field validity to true since it should be the responsibility of 'required' to stop blank entries
ngModelCtrl.$setValidity('ipAddress', true);
Consider simplifying this complex logical expression. Open
Open
if ((event.which < 46 && event.which !== 0 && event.which !== 8 && event.which !== 13)
|| event.which === 47
|| event.which > 57 && !(ctrlDown && (event.which === 99 || event.which === 118 || event.which === 120))) {
// Stop key press from propagating
event.preventDefault();
Function evalInput
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function evalInput(val) {
// If val is falsy (undefined, empty string, etc)...
if (!val) {
// Set the field validity to true since it should be the responsibility of 'required' to stop blank entries
ngModelCtrl.$setValidity('ipAddress', true);
Avoid deeply nested control flow statements. Open
Open
if (!port || !isNumeric(arrayVal) || port > 65535) {
// Set validity tracker to false
validationResult = false;
}
Avoid deeply nested control flow statements. Open
Open
else if (requirePort) {
// Set validity tracker to false
validationResult = false;
}