Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
Coca
提交
ec32a82c
C
Coca
项目概览
Phodal
/
Coca
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Coca
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
ec32a82c
编写于
12月 26, 2019
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: remove unused class
上级
9d6e382f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
11 deletion
+6
-11
core/domain/refactor/rename/rename_method.go
core/domain/refactor/rename/rename_method.go
+0
-4
core/domain/refactor/unused/remove_unused_import.go
core/domain/refactor/unused/remove_unused_import.go
+0
-1
core/domain/refactor/unused_classes/UnusedClassesApp.go
core/domain/refactor/unused_classes/UnusedClassesApp.go
+6
-6
未找到文件。
core/domain/refactor/rename/rename_method.go
浏览文件 @
ec32a82c
...
...
@@ -2,7 +2,6 @@ package unused
import
(
"encoding/json"
models2
"github.com/phodal/coca/core/domain/refactor/base/models"
support3
"github.com/phodal/coca/core/domain/refactor/rename/support"
.
"github.com/phodal/coca/core/models"
"github.com/phodal/coca/core/support"
...
...
@@ -12,7 +11,6 @@ import (
)
var
parsedChange
[]
support3
.
RefactorChangeRelate
var
nodes
[]
models2
.
JMoveStruct
type
RemoveMethodApp
struct
{
}
...
...
@@ -23,7 +21,6 @@ var conf string
var
parsedDeps
[]
JClassNode
func
RenameMethodApp
(
dep
string
,
p
string
)
*
RemoveMethodApp
{
nodes
=
nil
depsFile
=
dep
configPath
=
p
return
&
RemoveMethodApp
{}
...
...
@@ -50,7 +47,6 @@ func (j *RemoveMethodApp) Start() {
}
func
startParse
(
nodes
[]
JClassNode
,
relates
[]
support3
.
RefactorChangeRelate
)
{
for
_
,
pkgNode
:=
range
nodes
{
for
_
,
related
:=
range
relates
{
oldInfo
:=
support3
.
BuildMethodPackageInfo
(
related
.
OldObj
)
...
...
core/domain/refactor/unused/remove_unused_import.go
浏览文件 @
ec32a82c
...
...
@@ -13,7 +13,6 @@ import (
)
var
currentFile
string
var
moveConfig
string
var
configPath
string
type
RemoveUnusedImportApp
struct
{
...
...
core/domain/refactor/unused_classes/UnusedClassesApp.go
浏览文件 @
ec32a82c
package
main
import
(
.
"github.com/phodal/coca/core/models"
"github.com/phodal/coca/core/support"
"encoding/json"
"fmt"
.
"github.com/phodal/coca/core/models"
"github.com/phodal/coca/core/support"
"sort"
"strings"
)
var
parsedDeps
[]
JClassNode
func
main
()
{
func
main
()
{
var
analysisPackage
=
""
file
:=
support
.
ReadFile
(
"deps.json"
)
if
file
==
nil
{
...
...
@@ -20,7 +20,7 @@ func main() {
_
=
json
.
Unmarshal
(
file
,
&
parsedDeps
)
sourceClasses
:=
make
(
map
[
string
]
string
)
targetlasses
:=
make
(
map
[
string
]
string
)
target
C
lasses
:=
make
(
map
[
string
]
string
)
for
_
,
node
:=
range
parsedDeps
{
if
strings
.
Contains
(
node
.
Package
,
analysisPackage
)
{
...
...
@@ -31,14 +31,14 @@ func main() {
for
_
,
methodCall
:=
range
node
.
MethodCalls
{
if
strings
.
Contains
(
methodCall
.
Package
,
analysisPackage
)
{
className
:=
methodCall
.
Package
+
"."
+
methodCall
.
Class
targetlasses
[
className
]
=
className
target
C
lasses
[
className
]
=
className
}
}
}
var
excludePackage
[]
string
=
nil
for
_
,
clz
:=
range
sourceClasses
{
if
targetlasses
[
clz
]
!=
clz
{
if
target
C
lasses
[
clz
]
!=
clz
{
excludePackage
=
append
(
excludePackage
,
clz
)
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录