From bd9979194f0ac741ce170a38d7256e13539651df Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 28 May 2016 16:38:43 -0400 Subject: [PATCH] catalog: tweak documentation score especially, private things, redefinitions and test_suites count for peanuts. Signed-off-by: Jean Privat --- src/catalog.nit | 31 +++++++++++++++++-------------- tests/sav/nitcatalog_args1.res | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/catalog.nit b/src/catalog.nit index 1743179..92510bc 100644 --- a/src/catalog.nit +++ b/src/catalog.nit @@ -362,8 +362,9 @@ class Catalog var doc_score = 0.0 for g in mpackage.mgroups do mmodules += g.mmodules.length - entity_score += 1.0 - if g.mdoc != null then doc_score += 1.0 + var gs = 1.0 + entity_score += gs + if g.mdoc != null then doc_score += gs for m in g.mmodules do var source = m.location.file if source != null then @@ -382,21 +383,23 @@ class Catalog loc += file.line_starts.length - 1 end end - entity_score += 1.0 - if m.mdoc != null then doc_score += 1.0 + var ms = gs + if m.is_test_suite then ms /= 100.0 + entity_score += ms + if m.mdoc != null then doc_score += ms else ms /= 10.0 for cd in m.mclassdefs do - var s = 0.2 - if not cd.is_intro then s /= 10.0 - if not cd.mclass.visibility <= private_visibility then s /= 10.0 - entity_score += s - if cd.mdoc != null then doc_score += s + var cs = ms * 0.2 + if not cd.is_intro then cs /= 100.0 + if not cd.mclass.visibility <= private_visibility then cs /= 100.0 + entity_score += cs + if cd.mdoc != null then doc_score += cs mclasses += 1 for pd in cd.mpropdefs do - s = 0.1 - if not pd.is_intro then s /= 10.0 - if not pd.mproperty.visibility <= private_visibility then s /= 10.0 - entity_score += s - if pd.mdoc != null then doc_score += s + var ps = ms * 0.1 + if not pd.is_intro then ps /= 100.0 + if not pd.mproperty.visibility <= private_visibility then ps /= 100.0 + entity_score += ps + if pd.mdoc != null then doc_score += ps if not pd isa MMethodDef then continue mmethods += 1 end diff --git a/tests/sav/nitcatalog_args1.res b/tests/sav/nitcatalog_args1.res index 19b015f..f97fee4 100644 --- a/tests/sav/nitcatalog_args1.res +++ b/tests/sav/nitcatalog_args1.res @@ -76,7 +76,7 @@

Quality

Tags

test, game

Requirements

-- 1.7.9.5