Conditions | 11 |
Paths | 11 |
Total Lines | 31 |
Code Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | 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 |
||
56 | public static function getGeneratorByName(string $name): GeneratorPoint |
||
57 | { |
||
58 | $adapter = MathAdapterFactory::getAdapter(); |
||
59 | $nistFactory = self::getNistFactory($adapter); |
||
60 | $secpFactory = self::getSecpFactory($adapter); |
||
61 | |||
62 | switch ($name) { |
||
63 | case NistCurve::NAME_P192: |
||
64 | return $nistFactory->generator192(); |
||
65 | case NistCurve::NAME_P224: |
||
66 | return $nistFactory->generator224(); |
||
67 | case NistCurve::NAME_P256: |
||
68 | return $nistFactory->generator256(); |
||
69 | case NistCurve::NAME_P384: |
||
70 | return $nistFactory->generator384(); |
||
71 | case NistCurve::NAME_P521: |
||
72 | return $nistFactory->generator521(); |
||
73 | case SecgCurve::NAME_SECP_112R1: |
||
74 | return $secpFactory->generator112r1(); |
||
75 | case SecgCurve::NAME_SECP_192K1: |
||
76 | return $secpFactory->generator192k1(); |
||
77 | case SecgCurve::NAME_SECP_256K1: |
||
78 | return $secpFactory->generator256k1(); |
||
79 | case SecgCurve::NAME_SECP_256R1: |
||
80 | return $secpFactory->generator256r1(); |
||
81 | case SecgCurve::NAME_SECP_384R1: |
||
82 | return $secpFactory->generator384r1(); |
||
83 | default: |
||
84 | $error = new UnsupportedCurveException('Unknown generator.'); |
||
85 | $error->setCurveName($name); |
||
86 | throw $error; |
||
87 | } |
||
108 |
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