Skip to content

Commit eb20b3a

Browse files
committed
feat: 移除贡献数量对开源项目的判断
1 parent b63101c commit eb20b3a

1 file changed

Lines changed: 6 additions & 25 deletions

File tree

src/core/project-classifier.ts

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ export class ProjectClassifier {
6565
// 维度3: 月光族模式
6666
const moonlightingResult = this.detectMoonlightingPattern(rawData.byHour, rawData.byDay, rawData.dayHourCommits)
6767

68-
// 维度4: 贡献者数量(强特征,可单独判定
68+
// 贡献者数量(仅用于记录,不参与判断
6969
const contributorsCount = rawData.contributors || 0
7070

71-
// 综合判断
71+
// 综合判断(不再使用贡献者数量作为判断依据)
7272
const { projectType, confidence, reasoning } = this.makeDecision(
7373
regularityResult,
7474
weekendResult,
75-
moonlightingResult,
76-
contributorsCount
75+
moonlightingResult
7776
)
7877

7978
return {
@@ -383,12 +382,12 @@ export class ProjectClassifier {
383382

384383
/**
385384
* 综合决策
385+
* 注意:贡献者数量不再作为判断依据,因为大公司项目也可能有很多贡献者
386386
*/
387387
private static makeDecision(
388388
regularity: ProjectClassificationResult['dimensions']['workTimeRegularity'],
389389
weekend: ProjectClassificationResult['dimensions']['weekendActivity'],
390-
moonlighting: ProjectClassificationResult['dimensions']['moonlightingPattern'],
391-
contributorsCount: number
390+
moonlighting: ProjectClassificationResult['dimensions']['moonlightingPattern']
392391
): {
393392
projectType: ProjectType
394393
confidence: number
@@ -398,16 +397,7 @@ export class ProjectClassifier {
398397

399398
// ========== 强特征判断(单独满足即可判定为开源项目)==========
400399

401-
// 强特征1: 贡献者数量众多(>=50 人)
402-
if (contributorsCount >= 50) {
403-
return {
404-
projectType: ProjectType.OPEN_SOURCE,
405-
confidence: Math.min(95, 70 + Math.floor(contributorsCount / 10)),
406-
reasoning: `贡献者数量众多 (${contributorsCount} 人),典型的开源项目特征`,
407-
}
408-
}
409-
410-
// 强特征2: 工作时间规律性极低(<= 25 分)
400+
// 强特征: 工作时间规律性极低(<= 25 分)
411401
if (regularity.score <= 25) {
412402
return {
413403
projectType: ProjectType.OPEN_SOURCE,
@@ -432,15 +422,6 @@ export class ProjectClassifier {
432422
reasons.push(`工作时间规律性中等 (${regularity.score}/100)`)
433423
}
434424

435-
// 贡献者数量(20-49人给予适度加分)
436-
if (contributorsCount >= 20 && contributorsCount < 50) {
437-
ossScore += 20
438-
reasons.push(`贡献者较多 (${contributorsCount} 人)`)
439-
} else if (contributorsCount >= 10 && contributorsCount < 20) {
440-
ossScore += 10
441-
reasons.push(`贡献者数量中等 (${contributorsCount} 人)`)
442-
}
443-
444425
// 周末活跃度分析
445426
if (weekend.ratio >= 0.30) {
446427
ossScore += 30

0 commit comments

Comments
 (0)