BsModel.go 1.1 KB
Newer Older
P
Phodal Huang 已提交
1 2
package models

P
Phodal Huang 已提交
3
type BsJClass struct {
P
Phodal Huang 已提交
4 5 6 7 8 9
	Package     string
	Class       string
	Type        string
	Path        string
	Extends     string
	Implements  []string
P
Phodal Huang 已提交
10 11
	Methods     []BsJMethod
	MethodCalls []BsJMethodCall
P
Phodal Huang 已提交
12 13 14
	ClassBS     ClassBadSmellInfo
}

P
Phodal Huang 已提交
15
type BsJMethodCall struct {
P
Phodal Huang 已提交
16 17 18 19 20 21 22 23 24 25
	Package           string
	Type              string
	Class             string
	MethodName        string
	StartLine         int
	StartLinePosition int
	StopLine          int
	StopLinePosition  int
}

P
Phodal Huang 已提交
26
type BsJMethod struct {
P
Phodal Huang 已提交
27 28 29 30 31 32 33
	Name              string
	Type              string
	StartLine         int
	StartLinePosition int
	StopLine          int
	StopLinePosition  int
	MethodBody        string
34
	Modifier          string
P
Phodal Huang 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
	Parameters        []JFullParameter
	MethodBs          MethodBadSmellInfo
}

type MethodBadSmellInfo struct {
	IfSize     int
	SwitchSize int
}

type ClassBadSmellInfo struct {
	OverrideSize  int
	PublicVarSize int
}

type JFullParameter struct {
	Name string
	Type string
}

P
Phodal Huang 已提交
54
func NewJFullClassNode() BsJClass {
55
	info := &ClassBadSmellInfo{0, 0}
P
Phodal Huang 已提交
56
	return *&BsJClass{
P
Phodal Huang 已提交
57 58 59 60 61 62 63 64 65 66
		"",
		"",
		"",
		"",
		"",
		nil,
		nil,
		nil,
		*info}
}