未验证 提交 d0f2db26 编写于 作者: P Phodal Huang

feat: add large class

上级 e6105a6e
......@@ -53,11 +53,15 @@ func (j *BadSmellApp) AnalysisPath(codeDir string) []BadSmellModel {
func analysisBadSmell(nodes []JClassNode) []BadSmellModel {
var badSmellList []BadSmellModel
for _, node := range nodes {
// To be Defined
// To be Defined number
if node.Type == "Class" && len(node.Methods) < 1 {
badSmellList = append(badSmellList, *&BadSmellModel{node.Path, "", "lazyElement"})
}
if node.Type == "Class" && len(node.Methods) > 30 {
badSmellList = append(badSmellList, *&BadSmellModel{node.Path, "", "largeClass"})
}
// Long Method
for _, method := range node.Methods {
if method.StopLine-method.StartLine > 50 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册