003_0001 - NumberOfModules
More than 20 modules in project
Consider a multi-app stategy to avoid creating one big (unmaintainable) monstrous application.
Metadata
authors:
- Xiwen Cheng <x@cinaq.com>
category: Maintainability
input: Metadata.yaml
rulename: NumberOfModules
rulenumber: '003_0001'
scope: package
severity: MEDIUM
Description
The bigger the application, the harder to maintain.
Remediation
Consider a multi-app stategy to avoid creating one big (unmaintainable) monstrous application.
Test cases
package app.mendix.modules.number_of_modules
import rego.v1
# Test data
module = {
"Name": "Module",
"Attributes": {
"FromAppStore": false,
}
}
thirty := numbers.range(1, 30)
modules_30 = [
module | n := thirty[_]
]
# Test cases
test_empty if {
allow with input as {"Modules": null}
}
test_1_module if {
allow with input as {"Modules": [module]}
}
test_2_modules if {
allow with input as {"Modules": [module, module]}
}
test_30_modules if {
not allow with input as {"Modules": modules_30}
}