diff --git a/pkg/domain/bs_domain/bs_node.go b/pkg/domain/bs_domain/bs_node.go index b0aa39978459b80baa7c9ba3921f60f1f7dd60a1..1d07b5b84d88f0bb6b28c87bb4494a317555111d 100644 --- a/pkg/domain/bs_domain/bs_node.go +++ b/pkg/domain/bs_domain/bs_node.go @@ -30,7 +30,7 @@ type BsJMethod struct { Type string MethodBody string Modifier string - Parameters []JFullParameter + Parameters []core_domain.CodeProperty MethodBs MethodBadSmellInfo Position core_domain.CodePosition } @@ -66,11 +66,6 @@ type ClassBadSmellInfo struct { PublicVarSize int } -type JFullParameter struct { - Name string - Type string -} - func NewJFullClassNode() BsJClass { info := &ClassBadSmellInfo{0, 0} return BsJClass{ diff --git a/pkg/infrastructure/ast/bs/bad_smell_listener.go b/pkg/infrastructure/ast/bs/bad_smell_listener.go index 9ff5cad35c7dc5c13081a353b624122fd2f801c8..d5a15496ffe7ec0dce97aff22744b335aaf35b0f 100644 --- a/pkg/infrastructure/ast/bs/bad_smell_listener.go +++ b/pkg/infrastructure/ast/bs/bad_smell_listener.go @@ -115,7 +115,7 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD typeType := ctx.TypeTypeOrVoid().GetText() - var methodParams []bs_domain.JFullParameter = nil + var methodParams []core_domain.CodeProperty = nil parameters := ctx.FormalParameters() if parameters != nil { if reflect.TypeOf(parameters.GetChild(1)).String() == "*parser.FormalParameterListContext" { @@ -125,7 +125,7 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD paramContext := param.(*FormalParameterContext) paramType := paramContext.TypeType().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) typeType := ctx.TypeTypeOrVoid().GetText() methodBody := ctx.MethodBody().GetText() - var methodParams []bs_domain.JFullParameter = nil + var methodParams []core_domain.CodeProperty = nil parameters := ctx.FormalParameters() if parameters != nil { if reflect.TypeOf(parameters.GetChild(1)).String() == "*parser.FormalParameterListContext" { @@ -194,7 +194,7 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext) paramContext := param.(*FormalParameterContext) paramType := paramContext.TypeType().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 }