| Total Complexity | 9 |
| Complexity/F | 3 |
| Lines of Code | 46 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | /** |
||
| 23 | var Translator = new Translate([]); |
||
|
|
|||
| 24 | |||
| 25 | Validation.add( |
||
| 26 | 'validate-bank-code', Translator.translate('Bank code must contain 8 digits'), function (value) { |
||
| 27 | value = value.replace(/\s/g, ''); |
||
| 28 | if (value == '') { |
||
| 29 | return true; |
||
| 30 | } |
||
| 31 | |||
| 32 | if (value.length != 8) { |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | |||
| 36 | return true; |
||
| 37 | } |
||
| 38 | ); |
||
| 39 | |||
| 40 | Validation.add( |
||
| 41 | 'validate-sepa-iban', Translator.translate('IBAN should contain only letters and digits'), function (value) { |
||
| 42 | value = value.replace(/\s/g, ''); |
||
| 43 | if (value == '') { |
||
| 44 | return true; |
||
| 45 | } |
||
| 46 | |||
| 47 | if (!/[a-zA-Z]{2}[A-Za-z0-9]{10,}$/.test(value)) { |
||
| 48 | return false; |
||
| 49 | } |
||
| 50 | |||
| 51 | return true; |
||
| 52 | } |
||
| 53 | ); |
||
| 54 | |||
| 55 | Validation.add( |
||
| 56 | 'validate-sepa-bic', Translator.translate('BIC can contain only 8-11 characters: digits and letters'), function (value) { |
||
| 57 | value = value.replace(/\s/g, ''); |
||
| 58 | if (value == '') { |
||
| 59 | return true; |
||
| 60 | } |
||
| 61 | |||
| 62 | if (!/[A-Za-z0-9]{8,11}$/.test(value)) { |
||
| 63 | return false; |
||
| 64 | } |
||
| 65 | |||
| 66 | return true; |
||
| 67 | } |
||
| 68 | ); |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.