From 0909cdb78a1d79efa56dc0967904fa2fd8bd726b Mon Sep 17 00:00:00 2001 From: thindil Date: Fri, 5 Apr 2024 04:16:56 +0000 Subject: [PATCH] tests: updated the program's configuration FossilOrigin-Name: 572480de395c1b01b63cfb3647c689b61e71bd5cb6a2d53d9a8689c5703bbd90 --- config/nimalyzer.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/nimalyzer.cfg b/config/nimalyzer.cfg index c7881fb..bcbd77d 100644 --- a/config/nimalyzer.cfg +++ b/config/nimalyzer.cfg @@ -184,6 +184,7 @@ message Checking the program, tools and the program's unit tests # 15. If any `if` statement can be replaced with `case` statement due to large amount of branches. # 16. If any code block doesn't exceed limit of cyclomatic complexity. # 17. If any `try` statement doesn't have empty `except` branch +# 18. If all object's type's declarations contains only private fields. # # :: check hasPragma procedures contractual "raises: [*" "tags: [*" @@ -248,6 +249,9 @@ explanation A code with high cyclomatic complexity is hard to understand and mai check not trystatements empty explanation Except branches with names of exceptions made code more readable. It also prevents problems when the checked code will start propagating new exceptions. +check not objects publicfields +explanation Each object's declaration should define also getters and setters for its fields. It made maintaining the code easier, when the type will be upgraded or required to use in multithread environment. + # Search rules # ------------ # Search rules are similar to the check rules. The main difference is that they @@ -370,3 +374,6 @@ explanation A code with high cyclomatic complexity is hard to understand and mai check not trystatements empty explanation Except branches with names of exceptions made code more readable. It also prevents problems when the checked code will start propagating new exceptions. + +check not objects publicfields +explanation Each object's declaration should define also getters and setters for its fields. It made maintaining the code easier, when the type will be upgraded or required to use in multithread environment.