Skip to content

Commit

Permalink
Minor cleanups and nomenclature fixes
Browse files Browse the repository at this point in the history
 - The 'plist' command which was undocumented for a few releases now has
   been removed permanently.
 - Argument list and help of many commands have been made better
 - The "old-style" 'checkers' command is dropped in favour of the new
   one introduced back in 5.8.
 - Most 'cmd' subcommands take run-name as a positional argument, rather
   than "--name RUN_NAME".
 - Thrift files have been reformatted to a new scheme of comments and
   naming.
  • Loading branch information
whisperity committed Sep 6, 2017
1 parent 9d6bde0 commit f2003cc
Show file tree
Hide file tree
Showing 41 changed files with 300 additions and 953 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ background process. By default it will listen on `localhost:8001`.

Analyze your project with the check command:

CodeChecker check -n test-check -b "cd ~/your-project && make clean && make"
CodeChecker check test-check -b "cd ~/your-project && make clean && make"

### View results

Expand Down
4 changes: 2 additions & 2 deletions api/authentication.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ service codeCheckerAuthentication {
list<string> getAcceptedAuthMethods(),

// handles creating a session token for the user
string performLogin(1: string auth_method,
2: string auth_string)
string performLogin(1: string authMethod,
2: string authString)
throws (1: shared.RequestFailed requestError),

// performs logout action for the user (must be called from the corresponding valid session)
Expand Down
107 changes: 45 additions & 62 deletions api/report_server.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -20,58 +20,53 @@ namespace cpp cc.service.codechecker
const i64 MAX_QUERY_SIZE = 500
//=================================================

//-----------------------------------------------------------------------------
struct RunData{
1: i64 runId, // unique id of the run
2: string runDate, // date of the run
3: string name, // human readable name of the run
4: i64 duration, // duration of the run; -1 if not finished
5: i64 resultCount, // number of results in the run
6: string runCmd, // the used check command
7: optional bool can_delete // true if codeCheckerDBAccess::removeRunResults()
// is allowed on this run (see issue 151)
8: map<shared.DetectionStatus, i32> detectionStatusCount
// this maps the detection status to its count
struct RunData {
1: i64 runId, // Unique id of the run.
2: string runDate, // Date of the run last updated.
3: string name, // Human-given identifier.
4: i64 duration, // Duration of the run (-1 if not finished).
5: i64 resultCount, // Number of results in the run.
6: string runCmd, // The used check command.
// This maps the detection status to its count
7: map<shared.DetectionStatus, i32> detectionStatusCount
}
typedef list<RunData> RunDataList

struct RunReportCount{
struct RunReportCount {
1: i64 runId, // unique id of the run
2: string name, // human readable name of the run
3: i64 reportCount
}
typedef list<RunReportCount> RunReportCounts

struct ReviewData{
struct ReviewData {
1: shared.ReviewStatus status,
2: string comment,
3: string author,
4: string date
}

//-----------------------------------------------------------------------------
struct ReportData{
1: string checkerId, // the qualified id of the checker that reported this
2: string bugHash, // This is unique id of the concrete report.
3: string checkedFile, // this is a filepath
4: string checkerMsg, // description of the bug report
5: i64 reportId, // id of the report in the current run in the db
6: i64 fileId, // unique id of the file the report refers to
7: i64 line, // line number or the reports main section (not part of the path)
8: i64 column, // column number of the report main section (not part of the path)
9: shared.Severity severity // checker severity
10: ReviewData review // bug review status informations.
11: shared.DetectionStatus detectionStatus // state of the bug (see the enum constant values)
struct ReportData {
1: string checkerId, // The qualified name of the checker that reported this.
2: string bugHash, // This is unique id of the concrete report.
3: string checkedFile, // This is a filepath, the original main file the analyzer was called with.
4: string checkerMsg, // Description of the bug report.
5: i64 reportId, // id of the report in the current run in the db.
6: i64 fileId, // Unique id of the file the report refers to.
7: i64 line, // line number or the reports main section (not part of the path).
8: i64 column, // column number of the report main section (not part of the path).
9: shared.Severity severity // Checker severity.
10: ReviewData reviewData // Bug review status information.
11: shared.DetectionStatus detectionStatus // State of the bug (see the enum constant values).
}
typedef list<ReportData> ReportDataList

//-----------------------------------------------------------------------------
/**
* TODO: DEPRECATED
* Members of this struct are interpreted in "AND" relation with each other.
* So they need to match a single report at the same time.
*/
struct ReportFilter{
struct ReportFilter {
1: optional string filepath, // In the filters a single wildcard can be be used: *
2: optional string checkerMsg,
3: optional shared.Severity severity,
Expand All @@ -92,7 +87,7 @@ typedef list<ReportFilter> ReportFilterList
* Members of this struct are interpreted in "OR" relation with each other.
* Between the members there is "AND" relation.
*/
struct ReportFilter_v2{
struct ReportFilter_v2 {
1: list<string> filepath,
2: list<string> checkerMsg,
3: list<string> checkerName,
Expand All @@ -102,20 +97,17 @@ struct ReportFilter_v2{
7: list<shared.DetectionStatus> detectionStatus
}

//-----------------------------------------------------------------------------
struct ReportDetails{
1: shared.BugPathEvents pathEvents,
2: shared.BugPath executionPath
}

//-----------------------------------------------------------------------------
// TODO: This type is unused.
struct ReportFileData{
struct ReportFileData {
1: i64 reportFileId,
2: string reportFileContent
}

//-----------------------------------------------------------------------------
// default sorting of the results
enum SortType {
FILENAME,
Expand All @@ -125,78 +117,69 @@ enum SortType {
DETECTION_STATUS
}

//-----------------------------------------------------------------------------
enum Encoding {
DEFAULT,
BASE64
}

//-----------------------------------------------------------------------------
struct SourceFileData{
struct SourceFileData {
1: i64 fileId,
2: string filePath,
3: optional string fileContent
}

//-----------------------------------------------------------------------------
enum Order {
ASC,
DESC
}

//-----------------------------------------------------------------------------
struct SortMode{
struct SortMode {
1: SortType type,
2: Order ord
}

//-----------------------------------------------------------------------------
struct ReportDataTypeCount{
struct ReportDataTypeCount {
1: string checkerId,
2: shared.Severity severity,
3: i64 count
}
typedef list<ReportDataTypeCount> ReportDataTypeCountList

//-----------------------------------------------------------------------------
struct SkipPathData{
struct SkipPathData {
1: string path,
2: string comment
}
typedef list<SkipPathData> SkipPathDataList

//-----------------------------------------------------------------------------
// diff result types
enum DiffType {
NEW,
RESOLVED,
UNRESOLVED
}

//-----------------------------------------------------------------------------
struct CommentData {
1: i64 id,
1: i64 id,
2: string author,
3: string message,
4: string createdAt
}
typedef list<CommentData> CommentDataList


# CompareData is used as an optinal argument for multiple API calls.
# If not set the API calls will just simply filter or query the
# database for results or metrics.
# If set the API calls can be used in a compare mode where
# the results or metrics will be compared to the values set in the CompareData.
# In compare mode the baseline run ids should be set on the API
# (to what the results/metrics will be copared to) and the new run ids and the
# diff type should be set in the CompareData type.
// CompareData is used as an optinal argument for multiple API calls.
// If not set the API calls will just simply filter or query the
// database for results or metrics.
// If set the API calls can be used in a compare mode where
// the results or metrics will be compared to the values set in the CompareData.
// In compare mode the baseline run ids should be set on the API
// (to what the results/metrics will be copared to) and the new run ids and the
// diff type should be set in the CompareData type.
struct CompareData {
1: list<i64> run_ids,
2: DiffType diff_type,
1: list<i64> runIds,
2: DiffType diffType
}

//-----------------------------------------------------------------------------
service codeCheckerDBAccess {

// get the run Ids and dates from the database to select one run
Expand Down Expand Up @@ -459,7 +442,7 @@ service codeCheckerDBAccess {
// (sha256) and returns the ones which are not stored yet.
// PERMISSION: PRODUCT_STORE
list<string> getMissingContentHashes(
1: list<string> file_hashes)
1: list<string> fileHashes)
throws (1: shared.RequestFailed requestError),

// This function stores an entire run encapsulated and sent in a ZIP file.
Expand All @@ -475,15 +458,15 @@ service codeCheckerDBAccess {
// The "force" parameter removes existing analysis results for a run.
// PERMISSION: PRODUCT_STORE
i64 massStoreRun(
1: string run_name,
1: string runName,
2: string version,
3: string zipfile,
4: bool force)
4: bool force)
throws (1: shared.RequestFailed requestError),

// PERMISSION: PRODUCT_STORE
bool replaceConfigInfo(
1: i64 run_id,
1: i64 runId,
2: shared.CheckerConfigList values)
throws (1: shared.RequestFailed requestError),

Expand Down
20 changes: 7 additions & 13 deletions api/shared.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

const string API_VERSION = '6.0'

//-----------------------------------------------------------------------------
struct BugPathEvent {
1: i64 startLine,
2: i64 startCol,
Expand All @@ -18,7 +17,6 @@ struct BugPathEvent {
}
typedef list<BugPathEvent> BugPathEvents

//-----------------------------------------------------------------------------
struct BugPathPos {
1: i64 startLine,
2: i64 startCol,
Expand All @@ -29,23 +27,21 @@ struct BugPathPos {
}
typedef list<BugPathPos> BugPath

//-----------------------------------------------------------------------------
// TODO: This seems to be unused?
struct SuppressBugData {
1: string bug_hash,
2: string file_name,
1: string bugHash,
2: string fileName,
3: string comment
}
typedef list<SuppressBugData> SuppressBugList

//-----------------------------------------------------------------------------
struct ConfigValue {
1: string checker_name,
1: string checkerName,
2: string attribute,
3: string value
}
typedef list<ConfigValue> CheckerConfigList

//-----------------------------------------------------------------------------
enum Severity{
UNSPECIFIED = 0,
STYLE = 10,
Expand All @@ -55,18 +51,16 @@ enum Severity{
CRITICAL = 50
}

//-----------------------------------------------------------------------------
enum ErrorCode{
DATABASE,
IOERROR,
GENERAL,
AUTH_DENIED, //Authentication denied. We do not allow access to the service.
UNAUTHORIZED //Authorization denied. User does not have right to perform an action.
AUTH_DENIED, // Authentication denied - We do not allow access to the service.
UNAUTHORIZED // User does not have the rights to perform the action.
}

//-----------------------------------------------------------------------------
exception RequestFailed {
1: ErrorCode error_code,
1: ErrorCode errorCode,
2: string message
}

Expand Down
8 changes: 0 additions & 8 deletions bin/CodeChecker
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ def run_codechecker(checker_env, subcommand=None):
# wrapper entry point, add it to the command list).
# E.g. 'codechecker-log ...' is the same as 'CodeChecker log ...'.
checker_cmd.append(subcommand)
else:
# For some commands the "legacy" old implementation is different,
# such as the case with 'CodeChecker checkers' instead of
# 'codechecker-checkers'. For this, we use a little HACK here through
# environmental variables.
#
# TODO: Delete this once "old" commands are removed in a later release.
checker_env['CC_FROM_LEGACY_INVOKE'] = str(1)

checker_cmd.extend(sys.argv[1:])

Expand Down
Loading

0 comments on commit f2003cc

Please sign in to comment.