rspec/rules/S3848/xml/rule.adoc

38 lines
1.0 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
An XSD that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain, and having a lot of elements (``++xs:schema++``, ``++xs:import++``, ``++xs:element++``, ``++xs:simpleType++``, ``++xs:complexType++``, ``++xs:sequence++``, ``++xs:choice++``, ``++xs:all++``, ``++xs:extension++``, ``++xs:attribute++``, ``++xs:enumeration++``, ``++xs:complexContent++``, ``++xs:group++``) is an indication that an XSD has grown too large.
Above a specific threshold, it is strongly advised to refactor the XSD into smaller ones which focus on well defined topics.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Move some elements into one or more separate, sub-schemas so there are no more than X elements in this schema.
=== Parameters
.threshold
****
----
300
----
The maximum number of elements allowed in an XSD
****
=== Highlighting
``++<xs:schema++``
endif::env-github,rspecator-view[]