Class AcceptableModuleCouplingOrError
java.lang.Object
org.ek9lang.compiler.phase5.AcceptableModuleCouplingOrError
- All Implemented Interfaces:
BiConsumer<String, List<ParsedModule>>
class AcceptableModuleCouplingOrError
extends Object
implements BiConsumer<String, List<ParsedModule>>
Validates module-level efferent coupling against threshold and emits E11016 error if exceeded.
Unlike AcceptableCouplingOrError (construct-level), this operates at the module level
after all files in a module have been processed.
Module coupling counts the number of distinct external modules that a module depends on. High module coupling indicates a module that depends on too many other modules, making it fragile and difficult to maintain.
Threshold: 10 external modules (based on software architecture best practices, Martin 2002 "Agile Software Development").
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceFunctional interface to get the appropriate ErrorListener for a ParsedModule. -
Constructor Summary
ConstructorsConstructorDescriptionAcceptableModuleCouplingOrError(ModuleCouplingTracker moduleCouplingTracker, AcceptableModuleCouplingOrError.ErrorListenerLookup errorListenerLookup) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(String moduleName, List<ParsedModule> parsedModules) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
AcceptableModuleCouplingOrError
AcceptableModuleCouplingOrError(ModuleCouplingTracker moduleCouplingTracker, AcceptableModuleCouplingOrError.ErrorListenerLookup errorListenerLookup)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<String, List<ParsedModule>>
-