refactor: [one-bs] move jparam -> code param

上级 07db9e49
...@@ -30,7 +30,7 @@ type BsJMethod struct { ...@@ -30,7 +30,7 @@ type BsJMethod struct {
Type string Type string
MethodBody string MethodBody string
Modifier string Modifier string
Parameters []JFullParameter Parameters []core_domain.CodeProperty
MethodBs MethodBadSmellInfo MethodBs MethodBadSmellInfo
Position core_domain.CodePosition Position core_domain.CodePosition
} }
...@@ -66,11 +66,6 @@ type ClassBadSmellInfo struct { ...@@ -66,11 +66,6 @@ type ClassBadSmellInfo struct {
PublicVarSize int PublicVarSize int
} }
type JFullParameter struct {
Name string
Type string
}
func NewJFullClassNode() BsJClass { func NewJFullClassNode() BsJClass {
info := &ClassBadSmellInfo{0, 0} info := &ClassBadSmellInfo{0, 0}
return BsJClass{ return BsJClass{
......
...@@ -115,7 +115,7 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD ...@@ -115,7 +115,7 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD
typeType := ctx.TypeTypeOrVoid().GetText() typeType := ctx.TypeTypeOrVoid().GetText()
var methodParams []bs_domain.JFullParameter = nil var methodParams []core_domain.CodeProperty = nil
parameters := ctx.FormalParameters() parameters := ctx.FormalParameters()
if parameters != nil { if parameters != nil {
if reflect.TypeOf(parameters.GetChild(1)).String() == "*parser.FormalParameterListContext" { if reflect.TypeOf(parameters.GetChild(1)).String() == "*parser.FormalParameterListContext" {
...@@ -125,7 +125,7 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD ...@@ -125,7 +125,7 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD
paramContext := param.(*FormalParameterContext) paramContext := param.(*FormalParameterContext)
paramType := paramContext.TypeType().GetText() paramType := paramContext.TypeType().GetText()
paramValue := paramContext.VariableDeclaratorId().(*VariableDeclaratorIdContext).IDENTIFIER().GetText() paramValue := paramContext.VariableDeclaratorId().(*VariableDeclaratorIdContext).IDENTIFIER().GetText()
methodParams = append(methodParams, bs_domain.JFullParameter{Name: paramType, Type: paramValue}) methodParams = append(methodParams, core_domain.CodeProperty{TypeValue: paramType, TypeType: paramValue})
} }
} }
} }
...@@ -184,7 +184,7 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext) ...@@ -184,7 +184,7 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext)
typeType := ctx.TypeTypeOrVoid().GetText() typeType := ctx.TypeTypeOrVoid().GetText()
methodBody := ctx.MethodBody().GetText() methodBody := ctx.MethodBody().GetText()
var methodParams []bs_domain.JFullParameter = nil var methodParams []core_domain.CodeProperty = nil
parameters := ctx.FormalParameters() parameters := ctx.FormalParameters()
if parameters != nil { if parameters != nil {
if reflect.TypeOf(parameters.GetChild(1)).String() == "*parser.FormalParameterListContext" { if reflect.TypeOf(parameters.GetChild(1)).String() == "*parser.FormalParameterListContext" {
...@@ -194,7 +194,7 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext) ...@@ -194,7 +194,7 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext)
paramContext := param.(*FormalParameterContext) paramContext := param.(*FormalParameterContext)
paramType := paramContext.TypeType().GetText() paramType := paramContext.TypeType().GetText()
paramValue := paramContext.VariableDeclaratorId().(*VariableDeclaratorIdContext).IDENTIFIER().GetText() paramValue := paramContext.VariableDeclaratorId().(*VariableDeclaratorIdContext).IDENTIFIER().GetText()
methodParams = append(methodParams, bs_domain.JFullParameter{Name: paramType, Type: paramValue}) methodParams = append(methodParams, core_domain.CodeProperty{TypeValue: paramType, TypeType: paramValue})
localVars[paramValue] = paramType localVars[paramValue] = paramType
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册