Tag: maintainability

Catch and swallow exception

Swallowing exceptions, without re-throwing or logging them, is a bad practice.

Tensorflow enable ops determinism

Non-deterministic ops might return different outputs when run with the same inputs.

Outdated subprocess module API

Using outdated multiprocessing API calls and parameters is not recommended.

Risky use of dict get method

Using the get method from the dict class without default values can cause runtime exceptions.

Multidimensional list initialization using replication is error prone

list replication using replication operator creates references to the existing objects, not copies, which could introduce bugs.

AWS AppConfig

Always check for new version before fetching the latest version directly.

Notebook best practice violation

Best practices to improve the maintainability of notebooks.

Use of a deprecated method

This code uses deprecated methods, which suggests that it has not been recently reviewed or maintained.

Catch and rethrow exception

Catching and re-throwing an exception without further actions is redundant and wasteful.

Missing none check on response metadata

Response metadata was not checked to verify that it is not None.

Override of reserved variable names in a Lambda function

Overriding environment variables that are reserved by AWS Lambda might lead to unexpected behavior.

Direct dict object modification

Directly modifying the __dict__ object might cause undesirable behavior due to symbol table modification.

Catastrophic backtracking regex

Inefficient regular expression patterns can lead to catastrophic backtracking.

Improper error handling

Improper error handling can enable attacks and lead to unwanted behavior.

Pytorch control sources of randomness

Not setting seeds for the random number generators in Pytorch can lead to reproducibility issues.

Low maintainability with low class cohesion

Classes with low class cohesion contain unrelated operations which make them difficult to understand and less likely to be used.

Do not pass generic exception rule

Do not pass generic exception.

Mutable objects as default arguments of functions

Default values in Python are created exactly once, when the function is defined. If that object is changed, subsequent calls to the function will refer to the changed object, leading to confusion.

Violation of PEP8 programming recommendations

Violating PEP8 programming recommendations might make code difficult to read and can introduce ambiguity.

Complex code hard to maintain

Complex code can be difficult to read and hard to maintain.

Enabling and overriding debug feature

The Debug feature should not be enabled or overridden.

Use of an inefficient or incorrect API

Incorrect use of API leads to ambiguity and inconsistency

Avoid using nondeterministic Tensorflow API

Detects if nondeterministic tensorflow APIs are used.

Tensorflow control sources of randomness

Detects if a random seed is set before random number generation.

Dangerous global variables

Global variables can be dangerous and cause bugs because they can be simultaneously accessed from multiple sections of a program.

Multiple values in return statement is prone to error

Methods that return multiple values can be difficult to read and prone to error.