FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codehawk-cli/src/types/codehawk.ts at master · sgb-io/codehawk-cli · GitHub
sgb-io
/
codehawk-cli
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
4
Star
51
Code
Issues
4
Pull requests
3
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codehawk-cli
/
src
/
types
/
codehawk.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
153 lines (121 loc) · 3.25 KB
Breadcrumbs
codehawk-cli
/
src
/
types
/
codehawk.ts
Copy path
File metadata and controls
153 lines (121 loc) · 3.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// All option keys
type
SupportedStringArrayKeys
=
|
'badgesDirectory'
|
'excludeDirectories'
|
'excludeExact'
|
'excludeFilenames'
|
'extensions'
|
'skipDirectories'
type
SupportedBooleanOptions
=
'enableFlow'
type
SupportedNumberOptions
=
'minimumThreshold'
|
'cliOutputLimit'
export
type
AllOptionKeys
=
|
SupportedStringArrayKeys
|
SupportedBooleanOptions
|
SupportedNumberOptions
interface
StringArrayOption
{
type
:
'stringArray'
default
:
string
[
]
replaceDefault
:
boolean
}
interface
BooleanOption
{
type
:
'boolean'
default
:
boolean
replaceDefault
:
boolean
}
interface
NumberOption
{
type
:
'number'
default
:
number
replaceDefault
:
boolean
}
export
type
CodehawkOptions
=
{
[
key
in
SupportedStringArrayKeys
]
?:
StringArrayOption
}
&
{
[
key
in
SupportedBooleanOptions
]
?:
BooleanOption
}
&
{
[
key
in
SupportedNumberOptions
]
?:
NumberOption
}
export
type
AssembledOptions
=
{
[
key
in
SupportedStringArrayKeys
]
?:
string
[
]
}
&
{
[
key
in
SupportedBooleanOptions
]
?:
boolean
}
&
{
[
key
in
SupportedNumberOptions
]
?:
number
}
interface
CoverageMeasurement
{
total
:
number
covered
:
number
skipped
:
number
pct
:
number
}
type
SupportedCoverageMeasurements
=
|
'lines'
|
'functions'
|
'statements'
|
'branches'
type
CoverageMetrics
=
{
[
key
in
SupportedCoverageMeasurements
]
:
CoverageMeasurement
}
export
interface
CoverageSummary
{
[
key
:
string
]
:
CoverageMetrics
}
export
interface
CoverageMapping
{
path
:
string
coverage
:
CoverageMetrics
}
interface
BaseEntity
{
fullPath
:
string
path
:
string
filename
:
string
shouldAnalyze
:
boolean
}
export
interface
FileWithContents
{
path
:
string
filename
:
string
rawSource
:
string
|
undefined
// Undefined if parsing fails
}
// Parsed entities
export
interface
ParsedFile
extends
BaseEntity
{
type
:
'file'
}
export
interface
ParsedDirectory
extends
BaseEntity
{
type
:
'dir'
files
:
ParsedFile
[
]
}
export
type
ParsedEntity
=
ParsedFile
|
ParsedDirectory
// Parsed entities plus complexityReports
export
interface
AnalyzedFile
extends
ParsedFile
{
complexityReport
?:
CompleteCodehawkComplexityResult
}
// For when we have a guarantee of a complexity report
export
interface
AnalyzedFileWithReport
extends
ParsedFile
{
complexityReport
:
CompleteCodehawkComplexityResult
}
export
interface
AnalyzedDirectory
extends
BaseEntity
{
type
:
'dir'
files
:
AnalyzedFile
[
]
}
export
type
AnalyzedEntity
=
AnalyzedFile
|
AnalyzedDirectory
// Parsed entities plus complexityReports and timesDependedOn
export
interface
FullyAnalyzedFile
extends
AnalyzedFile
{
timesDependedOn
:
number
}
// Some operations are against analyzed files, but we don't care if they're fully analyzed
export
type
AnyAnalyzedFile
=
AnalyzedFile
|
FullyAnalyzedFile
export
interface
FullyAnalyzedDirectory
extends
BaseEntity
{
type
:
'dir'
files
:
FullyAnalyzedFile
[
]
}
export
type
FullyAnalyzedEntity
=
FullyAnalyzedFile
|
FullyAnalyzedDirectory
// Before coverage mapping
export
interface
CodehawkComplexityResult
extends
ComplexityResult
{
codehawkScore
:
number
}
// After coverage mapping
export
interface
CompleteCodehawkComplexityResult
extends
CodehawkComplexityResult
{
coverage
:
string
}
export
interface
ResultsSummary
{
average
:
number
median
:
number
worst
:
number
}
Back
|
FazBrowse Home
|
New Git URL