-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from wgliang/feature-single
Feature single merge master into goreporter2.0
- Loading branch information
Showing
66 changed files
with
4,318 additions
and
3,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,37 @@ | ||
package engine | ||
|
||
import ( | ||
"html/template" | ||
) | ||
|
||
type Reporter struct { | ||
Project string `json:"project"` | ||
Score int `json:"score"` | ||
UnitTestx UnitTest `json:"unit_test"` | ||
Cyclox map[string]Cycloi `json:"cyclo"` | ||
SimpleTips map[string][]string `json:"simple_tips"` | ||
CopyTips [][]string `json:"copy_tips"` | ||
ScanTips map[string][]string `json:"scan_tips"` | ||
DependGraph string `json:"depend_graph"` | ||
DeadCode []string `json:"dead_code"` | ||
NoTestPkg []string `json:"no_test_package"` | ||
SpellError []string `json:"spell_error"` | ||
} | ||
|
||
type UnitTest struct { | ||
AvgCover string `json:"average_cover"` | ||
PackagesTestDetail map[string]PackageTest `json:"packages_test_detail"` | ||
PackagesRaceDetail map[string][]string `json:"packages_race_detail"` | ||
// Error contains the line number and the reason for | ||
// an error output from a command | ||
type Error struct { | ||
LineNumber int `json:"line_number"` | ||
ErrorString string `json:"error_string"` | ||
} | ||
|
||
type PackageTest struct { | ||
IsPass bool `json:"is_pass"` | ||
Coverage string `json:"coverage"` | ||
Time float64 `json:"time"` | ||
// FileSummary contains the filename, location of the file | ||
// on GitHub, and all of the errors related to the file | ||
type Summary struct { | ||
Name string `json:"name"` | ||
Description string `json:"description"` | ||
Errors []Error `json:"errors"` | ||
} | ||
|
||
type Cycloi struct { | ||
Average string | ||
Result []string | ||
// Metric as template of report and will save all linters result | ||
// data.But may have some diffreence in diffrent linter. | ||
type Metric struct { | ||
Name string `json:"name"` | ||
Description string `json:"description"` | ||
Summaries map[string]Summary `json:"summaries"` | ||
Weight float64 `json:"weight"` | ||
Percentage float64 `json:"percentage"` | ||
Error string `json:"error"` | ||
} | ||
|
||
type Test struct { | ||
Path string | ||
Result int | ||
Time float64 | ||
Cover float64 | ||
} | ||
|
||
type File struct { | ||
Color string | ||
CycloVal string | ||
CycloInfo string | ||
} | ||
|
||
type Copycode struct { | ||
Files string | ||
Path []string | ||
} | ||
|
||
type Race struct { | ||
Pkg string | ||
Len string | ||
Leng string | ||
Info []string | ||
} | ||
|
||
type Simple struct { | ||
Path string | ||
Info string | ||
} | ||
|
||
type Scan struct { | ||
Path string | ||
Info string | ||
} | ||
|
||
type Deadcode struct { | ||
Path string | ||
Info string | ||
} | ||
type CycloInfo struct { | ||
Comp int | ||
Info string | ||
} | ||
type Cyclo struct { | ||
Pkg string | ||
Size int | ||
Info []CycloInfo | ||
} | ||
|
||
type HtmlData struct { | ||
Project string | ||
Score int | ||
Tests string | ||
TestSummaryCoverAvg string | ||
Races []Race | ||
NoTests string | ||
Simples string | ||
SimpleLevel int | ||
Deadcodes string | ||
Copycodes string | ||
Cyclos string | ||
CycloSummarysCycloAvg string | ||
CycloSummarysCyclo50 string | ||
CycloSummarysCyclo15 string | ||
DepGraph template.HTML | ||
} | ||
|
||
type ApolloMeta struct { | ||
Branch string `json:"branch"` | ||
Project string `json:"project"` | ||
CommitID string `json:"commitid"` | ||
CommitUser string `json:"commituser"` | ||
User string `json:"user"` | ||
UnintTestCover string `json:"uninttestcover"` | ||
StaticCheck string `json:"staticcheck"` | ||
CycloBig string `json:"cyclobig"` | ||
Score int `json:"score"` | ||
Starttime string `json:"starttime"` | ||
Endtime string `json:"endtime"` | ||
// Reporter is the top struct of GoReporter. | ||
type Reporter struct { | ||
Project string `json:"project"` | ||
Score int `json:"score"` | ||
Grade int `json:"grade"` | ||
Metrics map[string]Metric `json:"metrics"` | ||
Issues int `json:"issues"` | ||
TimeStamp string `json:"time_stamp"` | ||
} | ||
|
||
// type OptionMeta struct { | ||
// Branch string `json:"branch"` | ||
// CommitID string `json:"commitID"` | ||
// CommitUser string `json:"commitUser"` | ||
// User string `json:"user"` | ||
// } | ||
|
||
// type Value struct { | ||
// Filepath string `json:"filepath"` | ||
// Meta ApolloMeta `json:"meta"` | ||
// } |
Oops, something went wrong.