@@ -6925,9 +6925,6 @@ def _create_api_sections(self, package_name: str) -> list | None:
69256925 def _t(key: str, fallback: str) -> str:
69266926 return get_translation(key, lang) if lang != "en" else fallback
69276927
6928- # Use static threshold of 5 methods for large class separation
6929- method_threshold = 5
6930-
69316928 # ── Helper: build a class section with big-class splitting ────────
69326929 def _make_class_section(title: str, desc: str, class_names: list) -> list[dict]:
69336930 """Return section dicts (possibly with a Methods companion section)."""
@@ -6939,7 +6936,7 @@ def _make_class_section(title: str, desc: str, class_names: list) -> list[dict]:
69396936
69406937 for class_name in class_names:
69416938 method_count = categories["class_methods"].get(class_name, 0)
6942- if method_count > method_threshold :
6939+ if self._config.should_split_methods( method_count) :
69436940 class_contents.append({"name": class_name, "members": []})
69446941 separate_methods.append(class_name)
69456942 else:
@@ -7306,9 +7303,6 @@ def _create_api_sections_from_config(self, package_name: str) -> list | None:
73067303 mod_prefix = qualified.split(".")[0]
73077304 module_members.setdefault(mod_prefix, []).append(qualified)
73087305
7309- # Use the same big-class threshold as auto-discovery
7310- method_threshold = 5
7311-
73127306 sections = []
73137307
73147308 for section_config in reference_config:
@@ -7331,7 +7325,7 @@ def _create_api_sections_from_config(self, package_name: str) -> list | None:
73317325 # This is a module name — expand into its individual members
73327326 for member in module_members[item]:
73337327 method_count = categories["class_methods"].get(member, 0)
7334- if method_count > method_threshold :
7328+ if self._config.should_split_methods( method_count) :
73357329 section_contents.append(
73367330 {"name": member, "members": []}
73377331 ) # pragma: no cover
@@ -7341,7 +7335,7 @@ def _create_api_sections_from_config(self, package_name: str) -> list | None:
73417335 else:
73427336 # Regular item (class, function, etc.) — use as-is
73437337 method_count = categories["class_methods"].get(item, 0)
7344- if method_count > method_threshold :
7338+ if self._config.should_split_methods( method_count) :
73457339 section_contents.append({"name": item, "members": []})
73467340 large_classes_in_section.append(item)
73477341 else:
@@ -8044,9 +8038,6 @@ def _generate_config_with_reference(
80448038 class_methods = categories.get("class_methods", {})
80458039 class_method_names = categories.get("class_method_names", {})
80468040
8047- # Use static threshold of 5 methods for large class separation
8048- threshold = 5
8049-
80508041 # Track large classes that need separate method sections
80518042 large_classes: list[str] = []
80528043
@@ -8072,7 +8063,7 @@ def _generate_config_with_reference(
80728063 lines.append(" contents:")
80738064 for class_name in sorted(items):
80748065 method_count = class_methods.get(class_name, 0)
8075- if method_count > threshold :
8066+ if self._config.should_split_methods( method_count) :
80768067 lines.append(f" - name: {class_name}")
80778068 lines.append(f" members: false # {method_count} methods listed below")
80788069 large_classes.append(class_name)
0 commit comments