Skip to content

Commit

Permalink
refactor: rename import naming
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 7, 2021
1 parent 770972f commit 1dd3fae
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/application/call/call_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package call

import (
"github.com/phodal/coca/pkg/application/rcall"
apidomain2 "github.com/phodal/coca/pkg/domain/api_domain"
apidomain "github.com/phodal/coca/pkg/domain/api_domain"
"github.com/phodal/coca/pkg/domain/core_domain"
"github.com/phodal/coca/pkg/infrastructure/jpackage"
"strings"
Expand Down Expand Up @@ -33,7 +33,7 @@ func (c CallGraph) Analysis(funcName string, clzs []core_domain.CodeDataStruct,

// TODO: be a utils
func ToGraphviz(chain string) string {
//rankdir = LR;
// rankdir = LR;
var result = "digraph G {\n"
result += "rankdir = LR;\n"
result = result + chain
Expand Down Expand Up @@ -67,9 +67,9 @@ func BuildCallChain(funcName string, methodMap map[string][]string, diMap map[st
return "\n"
}

func (c CallGraph) AnalysisByFiles(restApis []apidomain2.RestAPI, deps []core_domain.CodeDataStruct, diMap map[string]string) (string, []apidomain2.CallAPI) {
func (c CallGraph) AnalysisByFiles(restApis []apidomain.RestAPI, deps []core_domain.CodeDataStruct, diMap map[string]string) (string, []apidomain.CallAPI) {
methodMap := BuildMethodMap(deps)
var apiCallSCounts []apidomain2.CallAPI
var apiCallSCounts []apidomain.CallAPI

results := "digraph G { \n"

Expand All @@ -81,7 +81,7 @@ func (c CallGraph) AnalysisByFiles(restApis []apidomain2.RestAPI, deps []core_do
apiCallChain := BuildCallChain(caller, methodMap, diMap)
chain = chain + apiCallChain

count := &apidomain2.CallAPI{
count := &apidomain.CallAPI{
HTTPMethod: restApi.HttpMethod,
Caller: caller,
URI: restApi.Uri,
Expand All @@ -99,9 +99,9 @@ func escapeStr(caller string) string {
return strings.ReplaceAll(caller, "\"", "\\\"")
}

func BuildMethodMap(clzs []core_domain.CodeDataStruct) map[string][]string {
func BuildMethodMap(structs []core_domain.CodeDataStruct) map[string][]string {
var methodMap = make(map[string][]string)
for _, clz := range clzs {
for _, clz := range structs {
for _, method := range clz.Functions {
methodName := method.BuildFullMethodName(clz)
methodMap[methodName] = method.GetAllCallString()
Expand Down

0 comments on commit 1dd3fae

Please sign in to comment.