FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlcheck/src/configuration.cpp at development · bitsoex/sqlcheck · GitHub
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
bitsoex
/
sqlcheck
Public archive
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlcheck
/
src
/
configuration.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
114 lines (90 loc) · 2.63 KB
Breadcrumbs
sqlcheck
/
src
/
configuration.cpp
Copy path
File metadata and controls
114 lines (90 loc) · 2.63 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
//
CONFIGURATION SOURCE
#
include
"
include/configuration.h
"
#
include
"
gflags/gflags.h
"
namespace
sqlcheck
{
std::string
RiskLevelToString
(
const
RiskLevel& risk_level){
switch
(risk_level) {
case
RISK_LEVEL_HIGH
:
return
"
HIGH RISK
"
;
case
RISK_LEVEL_MEDIUM
:
return
"
MEDIUM RISK
"
;
case
RISK_LEVEL_LOW
:
return
"
LOW RISK
"
;
case
RISK_LEVEL_NONE
:
return
"
HINTS
"
;
case
RISK_LEVEL_ALL
:
return
"
ALL ANTI-PATTERNS
"
;
case
RISK_LEVEL_INVALID
:
default
:
return
"
INVALID
"
;
}
}
std::string
RiskLevelToDetailedString
(
const
RiskLevel& risk_level){
switch
(risk_level) {
case
RISK_LEVEL_HIGH
:
return
"
ONLY HIGH RISK ANTI-PATTERNS
"
;
case
RISK_LEVEL_MEDIUM
:
return
"
ONLY MEDIUM AND HIGH RISK ANTI-PATTERNS
"
;
case
RISK_LEVEL_LOW
:
return
"
ONLY ANTI-PATTERNS
"
;
case
RISK_LEVEL_NONE
:
return
"
ALL ANTI-PATTERNS AND HINTS
"
;
case
RISK_LEVEL_ALL
:
return
"
ALL ANTI-PATTERNS
"
;
case
RISK_LEVEL_INVALID
:
default
:
return
"
INVALID
"
;
}
}
std::string
PatternTypeToString
(
const
PatternType& pattern_type){
switch
(pattern_type) {
case
PATTERN_TYPE_PHYSICAL_DATABASE_DESIGN
:
return
"
PHYSICAL_DATABASE_DESIGN ANTI-PATTERN
"
;
case
PATTERN_TYPE_LOGICAL_DATABASE_DESIGN
:
return
"
LOGICAL_DATABASE_DESIGN ANTI-PATTERN
"
;
case
PATTERN_TYPE_QUERY
:
return
"
QUERY ANTI-PATTERN
"
;
case
PATTERN_TYPE_APPLICATION
:
return
"
APPLICATION ANTI-PATTERN
"
;
case
PATTERN_TYPE_INVALID
:
default
:
return
"
INVALID
"
;
}
}
std::string
GetBooleanString
(
const
bool
& status){
if
(status ==
true
){
return
"
ENABLED
"
;
}
else
{
return
"
DISABLED
"
;
}
}
void
ValidateRiskLevel
(
const
Configuration &state) {
if
(state.
risk_level
<
RISK_LEVEL_ALL
|| state.
risk_level
>
RISK_LEVEL_HIGH
) {
printf
(
"
INVALID RISK LEVEL :: %d
\n
"
, state.
risk_level
);
exit
(
EXIT_FAILURE
);
}
else
{
printf
(
"
> %s :: %s
\n
"
,
"
RISK LEVEL
"
,
RiskLevelToDetailedString
(state.
risk_level
).
c_str
());
}
}
void
ValidateFileName
(
const
Configuration &state) {
if
(state.
file_name
.
empty
() ==
false
) {
printf
(
"
> %s :: %s
\n
"
,
"
SQL FILE NAME
"
,
state.
file_name
.
c_str
());
}
}
void
ValidateColorMode
(
const
Configuration &state) {
printf
(
"
> %s :: %s
\n
"
,
"
COLOR MODE
"
,
GetBooleanString
(state.
color_mode
).
c_str
());
}
void
ValidateVerbose
(
const
Configuration &state) {
printf
(
"
> %s :: %s
\n
"
,
"
VERBOSE MODE
"
,
GetBooleanString
(state.
verbose
).
c_str
());
}
void
ValidateDelimiter
(
const
Configuration &state) {
printf
(
"
> %s :: %s
\n
"
,
"
DELIMITER
"
,
state.
delimiter
.
c_str
());
}
}
//
namespace sqlcheck
Back
|
FazBrowse Home
|
New Git URL