| Conditions | 5 |
| Paths | 5 |
| Total Lines | 99 |
| Code Lines | 79 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 29 | public function RFCVectorsProvider() { |
||
| 30 | $pin = '1234'; |
||
| 31 | $pin_sha1 = '7110eda4d09e062aa5e4a390b0a572ac0d2c0220'; |
||
| 32 | |||
| 33 | $key20 = '3132333435363738393031323334353637383930'; |
||
| 34 | $key32 = '3132333435363738393031323334353637383930313233343536373839303132'; |
||
| 35 | $key64 = '31323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334'; |
||
| 36 | |||
| 37 | $tests = array( |
||
| 38 | array( |
||
| 39 | 'ocrasuite' => 'OCRA-1:HOTP-SHA1-6:QN08', |
||
| 40 | 'key' => $key20, |
||
| 41 | 'vectors' => array( |
||
| 42 | array('params' => array( 'Q' => '00000000' ), 'result' => '237653' ), |
||
| 43 | array('params' => array( 'Q' => '11111111' ), 'result' => '243178' ), |
||
| 44 | array('params' => array( 'Q' => '22222222' ), 'result' => '653583' ), |
||
| 45 | array('params' => array( 'Q' => '33333333' ), 'result' => '740991' ), |
||
| 46 | array('params' => array( 'Q' => '44444444' ), 'result' => '608993' ), |
||
| 47 | array('params' => array( 'Q' => '55555555' ), 'result' => '388898' ), |
||
| 48 | array('params' => array( 'Q' => '66666666' ), 'result' => '816933' ), |
||
| 49 | array('params' => array( 'Q' => '77777777' ), 'result' => '224598' ), |
||
| 50 | array('params' => array( 'Q' => '88888888' ), 'result' => '750600' ), |
||
| 51 | array('params' => array( 'Q' => '99999999' ), 'result' => '294470' ), |
||
| 52 | ) |
||
| 53 | ), |
||
| 54 | array( |
||
| 55 | 'ocrasuite' => 'OCRA-1:HOTP-SHA256-8:C-QN08-PSHA1', |
||
| 56 | 'key' => $key32, |
||
| 57 | 'pin_sha1' => $pin_sha1, |
||
| 58 | 'vectors' => array( |
||
| 59 | array('params' => array( 'C' => 0, 'Q' => '12345678' ), 'result' => '65347737' ), |
||
| 60 | array('params' => array( 'C' => 1, 'Q' => '12345678' ), 'result' => '86775851' ), |
||
| 61 | array('params' => array( 'C' => 2, 'Q' => '12345678' ), 'result' => '78192410' ), |
||
| 62 | array('params' => array( 'C' => 3, 'Q' => '12345678' ), 'result' => '71565254' ), |
||
| 63 | array('params' => array( 'C' => 4, 'Q' => '12345678' ), 'result' => '10104329' ), |
||
| 64 | array('params' => array( 'C' => 5, 'Q' => '12345678' ), 'result' => '65983500' ), |
||
| 65 | array('params' => array( 'C' => 6, 'Q' => '12345678' ), 'result' => '70069104' ), |
||
| 66 | array('params' => array( 'C' => 7, 'Q' => '12345678' ), 'result' => '91771096' ), |
||
| 67 | array('params' => array( 'C' => 8, 'Q' => '12345678' ), 'result' => '75011558' ), |
||
| 68 | array('params' => array( 'C' => 9, 'Q' => '12345678' ), 'result' => '08522129' ), |
||
| 69 | ) |
||
| 70 | ), |
||
| 71 | array( |
||
| 72 | 'ocrasuite' => 'OCRA-1:HOTP-SHA256-8:QN08-PSHA1', |
||
| 73 | 'key' => $key32, |
||
| 74 | 'pin_sha1' => $pin_sha1, |
||
| 75 | 'vectors' => array( |
||
| 76 | array('params' => array( 'Q' => '00000000' ), 'result' => '83238735' ), |
||
| 77 | array('params' => array( 'Q' => '11111111' ), 'result' => '01501458' ), |
||
| 78 | array('params' => array( 'Q' => '22222222' ), 'result' => '17957585' ), |
||
| 79 | array('params' => array( 'Q' => '33333333' ), 'result' => '86776967' ), |
||
| 80 | array('params' => array( 'Q' => '44444444' ), 'result' => '86807031' ), |
||
| 81 | ) |
||
| 82 | ), |
||
| 83 | array( |
||
| 84 | 'ocrasuite' => 'OCRA-1:HOTP-SHA512-8:C-QN08', |
||
| 85 | 'key' => $key64, |
||
| 86 | 'vectors' => array( |
||
| 87 | array('params' => array( 'C' => '00000', 'Q' => '00000000' ), 'result' => '07016083' ), |
||
| 88 | array('params' => array( 'C' => '00001', 'Q' => '11111111' ), 'result' => '63947962' ), |
||
| 89 | array('params' => array( 'C' => '00002', 'Q' => '22222222' ), 'result' => '70123924' ), |
||
| 90 | array('params' => array( 'C' => '00003', 'Q' => '33333333' ), 'result' => '25341727' ), |
||
| 91 | array('params' => array( 'C' => '00004', 'Q' => '44444444' ), 'result' => '33203315' ), |
||
| 92 | array('params' => array( 'C' => '00005', 'Q' => '55555555' ), 'result' => '34205738' ), |
||
| 93 | array('params' => array( 'C' => '00006', 'Q' => '66666666' ), 'result' => '44343969' ), |
||
| 94 | array('params' => array( 'C' => '00007', 'Q' => '77777777' ), 'result' => '51946085' ), |
||
| 95 | array('params' => array( 'C' => '00008', 'Q' => '88888888' ), 'result' => '20403879' ), |
||
| 96 | array('params' => array( 'C' => '00009', 'Q' => '99999999' ), 'result' => '31409299' ), |
||
| 97 | ) |
||
| 98 | ), |
||
| 99 | array( |
||
| 100 | 'ocrasuite' => 'OCRA-1:HOTP-SHA512-8:QN08-T1M', |
||
| 101 | 'key' => $key64, |
||
| 102 | 'vectors' => array( |
||
| 103 | array('params' => array( 'Q' => '00000000', 'T' => intval('132d0b6', 16) ), 'result' => '95209754' ), |
||
| 104 | array('params' => array( 'Q' => '11111111', 'T' => intval('132d0b6', 16) ), 'result' => '55907591' ), |
||
| 105 | array('params' => array( 'Q' => '22222222', 'T' => intval('132d0b6', 16) ), 'result' => '22048402' ), |
||
| 106 | array('params' => array( 'Q' => '33333333', 'T' => intval('132d0b6', 16) ), 'result' => '24218844' ), |
||
| 107 | array('params' => array( 'Q' => '44444444', 'T' => intval('132d0b6', 16) ), 'result' => '36209546' ), |
||
| 108 | ) |
||
| 109 | ), |
||
| 110 | ); |
||
| 111 | |||
| 112 | $data = array(); |
||
| 113 | |||
| 114 | foreach($tests as $test) { |
||
| 115 | $ocrasuite = $test['ocrasuite']; |
||
| 116 | foreach($test['vectors'] as $vector) { |
||
| 117 | $datainput = $vector['params']; |
||
| 118 | if (isset($test['pin'])) { |
||
| 119 | $datainput['P'] = $test['pin']; |
||
| 120 | } elseif (isset($test['pin_sha1'])) { |
||
| 121 | $datainput['P:hexdigest'] = $test['pin_sha1']; |
||
| 122 | } |
||
| 123 | $data[] = array($ocrasuite, $test['key'], $datainput, $vector['result']); |
||
| 124 | } |
||
| 125 | } |
||
| 126 | |||
| 127 | return $data; |
||
| 128 | } |
||
| 131 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths