| Total Complexity | 8 |
| Complexity/F | 1.6 |
| Lines of Code | 64 |
| Function Count | 5 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | /* |
||
| 8 | var check_logout_url = $("meta[name=check_logout_url]").attr('content'); |
||
| 9 | var check_login_url = $("meta[name=check_login_url]").attr('content'); |
||
| 10 | var auth_page = $("meta[name=auth_page]").attr('content'); |
||
| 11 | |||
| 12 | |||
| 13 | var token = $("meta[name=_token]").attr('content'); |
||
| 14 | var ipaddress = $("meta[name=ipaddress]").attr('content'); |
||
| 15 | var logout_url = $("meta[name=logout_url]").attr('content'); |
||
| 16 | var auth_check = $("meta[name=auth_check]").attr('content'); |
||
| 17 | var current_url = $("meta[name=current_url]").attr('content'); |
||
| 18 | |||
| 19 | setTimeout(function(){ |
||
| 20 | if(ipaddress == '') |
||
| 21 | { |
||
| 22 | ipaddress = $('.ip1').val()+'-'+$('.ip2').val(); |
||
| 23 | } |
||
| 24 | },500); |
||
| 25 | |||
| 26 | |||
| 27 | function init_cas() |
||
| 28 | { |
||
| 29 | if(auth_check == 1) |
||
| 30 | { |
||
| 31 | /*$.post(check_logout_url, |
||
| 32 | { |
||
| 33 | _token : token, |
||
| 34 | ipaddress : ipaddress |
||
| 35 | }, |
||
| 36 | function(response){ |
||
| 37 | if(response == 1) |
||
| 38 | { |
||
| 39 | // force logout |
||
| 40 | $.get(logout_url, function(response){ |
||
| 41 | return false; |
||
| 42 | }); |
||
| 43 | } |
||
| 44 | return false; |
||
| 45 | });*/ |
||
| 46 | } |
||
| 47 | else |
||
| 48 | { |
||
| 49 | $.post(check_login_url, |
||
| 50 | { |
||
| 51 | _token : token, |
||
| 52 | ipaddress : ipaddress |
||
| 53 | }, |
||
| 54 | function(response){ |
||
| 55 | if(response == 1) |
||
| 56 | { |
||
| 57 | window.location.href = auth_page; |
||
| 58 | } |
||
| 59 | else |
||
| 60 | { |
||
| 61 | $.get(logout_url, function(response){ |
||
|
|
|||
| 62 | return false; |
||
| 63 | }); |
||
| 64 | } |
||
| 65 | }); |
||
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | setTimeout(function(){ |
||
| 70 | init_cas(); |
||
| 71 | }, 1000); |
||
| 72 | |||
| 73 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.