beast icon indicating copy to clipboard operation
beast copied to clipboard

Fix issues identified by Codacy

Open karllark opened this issue 6 years ago • 2 comments

https://app.codacy.com/manual/kgordon/beast/dashboard

karllark avatar Nov 21 '19 14:11 karllark

There are a lot of style issues marked as "unidiomatic-typecheck" issues, e.g., type(sedgrid) == str should be isinstance(sedgrid, str), or type(lamb) in basestring should be isinstance(lamb, basestring). Note that the latter example will only work if basestring is a type or a tuple of types.

The other common issue (considered a security issue) is the use of assert. When compiled to bytecode, all statements such as assert (f1 >= 0) and (f2 >= 0) and (f1 <= 1) and (f2 <= 1) will be removed. The recommended way instead is:

if not (f1 >= 0) and (f2 >= 0) and (f1 <= 1) and (f2 <= 1):
    raise AssertionError()

jwuphysics avatar Nov 21 '19 16:11 jwuphysics

https://app.codacy.com/gh/BEAST-Fitting/beast/dashboard

karllark avatar Sep 23 '25 20:09 karllark