Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
Coca
提交
3caaa096
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 搜索 >>
未验证
提交
3caaa096
编写于
1月 09, 2020
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix more lint issues
上级
9869d2af
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
9 addition
and
15 deletion
+9
-15
cmd/tbs.go
cmd/tbs.go
+1
-2
pkg/application/deps/dep_app.go
pkg/application/deps/dep_app.go
+1
-1
pkg/application/git/log_parser.go
pkg/application/git/log_parser.go
+1
-3
pkg/application/refactor/base/java_refactor_listener.go
pkg/application/refactor/base/java_refactor_listener.go
+3
-3
pkg/application/refactor/unused_classes/unused_classes_app.go
...application/refactor/unused_classes/unused_classes_app.go
+1
-1
pkg/application/tbs/tbs_app_test.go
pkg/application/tbs/tbs_app_test.go
+1
-2
pkg/infrastructure/apriori/apriori.go
pkg/infrastructure/apriori/apriori.go
+1
-3
未找到文件。
cmd/tbs.go
浏览文件 @
3caaa096
...
...
@@ -28,9 +28,8 @@ var tbsCmd = &cobra.Command{
Long
:
``
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
files
:=
cocafile
.
GetJavaTestFiles
(
tbsCmdConfig
.
Path
)
var
identifiers
[]
domain
.
JIdentifier
identifiers
=
cmd_util
.
LoadTestIdentify
(
files
)
identifiers
:
=
cmd_util
.
LoadTestIdentify
(
files
)
identifiersMap
:=
domain
.
BuildIdentifierMap
(
identifiers
)
var
classes
[]
string
=
nil
...
...
pkg/application/deps/dep_app.go
浏览文件 @
3caaa096
...
...
@@ -44,7 +44,7 @@ func (d *DepAnalysisApp) AnalysisPath(path string, nodes []domain.JClassNode) []
var
needRemoveMap
=
make
(
map
[
int
]
int
)
for
depIndex
,
dep
:=
range
mavenDeps
{
for
key
,
_
:=
range
importMap
{
for
key
:=
range
importMap
{
if
strings
.
Contains
(
key
,
dep
.
GroupId
)
{
needRemoveMap
[
depIndex
]
=
depIndex
continue
...
...
pkg/application/git/log_parser.go
浏览文件 @
3caaa096
...
...
@@ -34,9 +34,7 @@ func UpdateMessageForChange(changedFile string) (string, string, string) {
var
oldLastChanged
=
changed
[
4
]
// TODO: support for Windows rename
if
changed
[
2
]
==
""
{
if
strings
.
HasPrefix
(
oldLastChanged
,
"/"
)
{
oldLastChanged
=
oldLastChanged
[
1
:
]
}
oldLastChanged
=
strings
.
TrimPrefix
(
oldLastChanged
,
"/"
)
}
oldFileName
=
changed
[
1
]
+
changed
[
2
]
+
oldLastChanged
...
...
pkg/application/refactor/base/java_refactor_listener.go
浏览文件 @
3caaa096
...
...
@@ -85,7 +85,7 @@ func (s *JavaRefactorListener) EnterTypeType(ctx *TypeTypeContext) {
func
(
s
*
JavaRefactorListener
)
EnterClassOrInterfaceType
(
ctx
*
ClassOrInterfaceTypeContext
)
{
identifiers
:=
ctx
.
AllIDENTIFIER
()
for
index
,
_
:=
range
identifiers
{
for
index
:=
range
identifiers
{
context
:=
ctx
.
IDENTIFIER
(
index
)
name
:=
context
.
GetText
()
startLine
:=
ctx
.
GetStart
()
.
GetLine
()
...
...
@@ -108,7 +108,7 @@ func (s *JavaRefactorListener) EnterAnnotation(ctx *AnnotationContext) {
func
(
s
*
JavaRefactorListener
)
EnterLambdaParameters
(
ctx
*
LambdaParametersContext
)
{
identifiers
:=
ctx
.
AllIDENTIFIER
()
for
index
,
_
:=
range
identifiers
{
for
index
:=
range
identifiers
{
context
:=
ctx
.
IDENTIFIER
(
index
)
name
:=
context
.
GetText
()
startLine
:=
ctx
.
GetStart
()
.
GetLine
()
...
...
@@ -153,7 +153,7 @@ func (s *JavaRefactorListener) EnterStatement(ctx *StatementContext) {
func
(
s
*
JavaRefactorListener
)
EnterCreatedName
(
ctx
*
CreatedNameContext
)
{
identifiers
:=
ctx
.
AllIDENTIFIER
()
for
index
,
_
:=
range
identifiers
{
for
index
:=
range
identifiers
{
context
:=
ctx
.
IDENTIFIER
(
index
)
name
:=
context
.
GetText
()
startLine
:=
ctx
.
GetStart
()
.
GetLine
()
...
...
pkg/application/refactor/unused_classes/unused_classes_app.go
浏览文件 @
3caaa096
...
...
@@ -35,6 +35,6 @@ func Refactoring(parsedDeps []JClassNode) []string {
}
}
sort
.
S
ort
(
sort
.
StringSlice
(
excludePackage
)
)
sort
.
S
trings
(
excludePackage
)
return
excludePackage
}
pkg/application/tbs/tbs_app_test.go
浏览文件 @
3caaa096
...
...
@@ -141,9 +141,8 @@ func buildTbsResult(codePath string) []TestBadSmell {
func
BuildTestAnalysisResultsByPath
(
codePath
string
)
(
map
[
string
]
domain
.
JIdentifier
,
[]
domain
.
JClassNode
)
{
files
:=
cocafile
.
GetJavaTestFiles
(
codePath
)
var
identifiers
[]
domain
.
JIdentifier
identifiers
=
cmd_util
.
LoadTestIdentify
(
files
)
identifiers
:
=
cmd_util
.
LoadTestIdentify
(
files
)
identifiersMap
:=
domain
.
BuildIdentifierMap
(
identifiers
)
var
classes
[]
string
=
nil
...
...
pkg/infrastructure/apriori/apriori.go
浏览文件 @
3caaa096
...
...
@@ -296,9 +296,7 @@ func (a *Apriori) generateRelationRecords(relationRecords chan RelationRecord, s
func
(
a
*
Apriori
)
createNextCandidates
(
prevCandidates
[][]
string
,
length
int
)
[][]
string
{
var
items
[]
string
for
_
,
candidate
:=
range
prevCandidates
{
for
_
,
item
:=
range
candidate
{
items
=
append
(
items
,
item
)
}
items
=
append
(
items
,
candidate
...
)
}
sort
.
Strings
(
items
)
items
=
a
.
uniqueItems
(
items
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录