J08nY / pyecsca

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
a month ago8 months old
RPA.build_tree has a cyclomatic complexity of 18 with "high" risk
212    P0: Optional[Point] = None
213    scalars: Optional[List[int]] = None
214
215    def build_tree(216        self,
217        params: DomainParameters,
218        tries: int = 10,
switch_sign_propagate has a cyclomatic complexity of 19 with "high" risk
 75    pass
 76
 77
 78def switch_sign_propagate( 79    node: CodeOpNode, variable: str, output_signs: Dict[str, int]
 80):
 81    if node.is_add:
Formula.__validate_assumptions has a cyclomatic complexity of 17 with "high" risk
157                    )
158                params[coord + str(i + 1)] = value
159
160    def __validate_assumptions(self, field, params):161        # Validate assumptions and compute formula parameters.
162        # TODO: Should this also validate coordinate assumptions and compute their parameters?
163        is_symbolic = any(isinstance(x, SymbolicMod) for x in params.values())
_create_params has a cyclomatic complexity of 25 with "high" risk
141        return self.curves[item]
142
143
144def _create_params(curve, coords, infty):145    if curve["field"]["type"] == "Binary":
146        raise ValueError("Binary field curves are currently not supported.")
147    if curve["field"]["type"] == "Extension":
eliminate_y has a cyclomatic complexity of 16 with "high" risk
359    return poly
360
361
362def eliminate_y(poly: Poly, model: CurveModel) -> Poly:363    """
364    Eliminate the remaining ys (only power 1).
365