Skip to content

Commit

Permalink
refactor: udpate design for doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jan 7, 2024
1 parent c2ec233 commit 6c61d53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ enum class CodeQualityType {
TestBadSmell,
JavaController,
JavaRepository,
JavaService;

JavaService,
DocComment,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cc.unitmesh.quality

import cc.unitmesh.quality.badsmell.BadsmellAnalyser
import cc.unitmesh.quality.documentation.DocCommentAnalyser
import cc.unitmesh.quality.extension.JavaServiceAnalyser
import cc.unitmesh.quality.extension.JavaRepositoryAnalyser
import cc.unitmesh.quality.extension.JavaControllerAnalyser
Expand All @@ -10,6 +11,9 @@ import chapi.domain.core.CodeDataStruct
import org.archguard.rule.core.Issue

interface QualityAnalyser {
/**
* Normal analysis, like [CodeQualityType.BadSmell], [CodeQualityType.TestBadSmell], etc.
*/
fun analysis(nodes: List<CodeDataStruct>): List<Issue>

companion object {
Expand All @@ -28,6 +32,7 @@ interface QualityAnalyser {
CodeQualityType.JavaController -> JavaControllerAnalyser(thresholds)
CodeQualityType.JavaRepository -> JavaRepositoryAnalyser(thresholds)
CodeQualityType.JavaService -> JavaServiceAnalyser(thresholds)
CodeQualityType.DocComment -> return emptyList()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import cc.unitmesh.quality.QualityAnalyser
import chapi.domain.core.CodeDataStruct
import org.archguard.rule.core.Issue

class DocCommentQualityAnalyser : QualityAnalyser {
class DocCommentAnalyser(thresholds: Map<String, Int>) : QualityAnalyser {
override fun analysis(nodes: List<CodeDataStruct>): List<Issue> {
TODO("Not yet implemented")
return listOf()
}
}
}

0 comments on commit 6c61d53

Please sign in to comment.