-
Notifications
You must be signed in to change notification settings - Fork 2k
Spelling #10743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spelling #10743
Changes from all commits
21caa4b
b105299
b95af76
3358c5f
c2a0dbe
6db3661
5755159
879158a
0581f2f
9b372f3
88408fb
e6998d4
3e6477f
c08cfe2
3b9546f
cbea5ec
479a4fb
e875496
b5bed9c
86ee8c2
29da681
f06c15b
0a4c724
8f7e76f
4e22033
22141e3
704aba8
c77f685
1146531
7e0bbf1
0919507
ba0f34a
71b0613
061d1ee
1a14c06
08a7953
9eac158
b9d8903
a8e5a12
9d6ea28
c92ce69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ This can occur when an operation performed on the open descriptor fails, and the | |
|
|
||
| <example> | ||
| <p>In the example below, the <code>sockfd</code> socket may remain open if an error is triggered. | ||
| The code should be updated to ensure that the socket is always closed when when the function ends. | ||
| The code should be updated to ensure that the socket is always closed when the function ends. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes there's a reason for doubled words. There didn't seem to be one here. |
||
| </p> | ||
| <sample src="DescriptorMayNotBeClosed.cpp" /> | ||
| </example> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,9 @@ | |
| <overview> | ||
| <p>This rule finds logical-not operator usage as an operator for in a bit-wise operation.</p> | ||
|
|
||
| <p>Due to the nature of logical operation result value, only the lowest bit could possibly be set, and it is unlikely to be intent in bitwise opeartions. Violations are often indicative of a typo, using a logical-not (<code>!</code>) opeartor instead of the bit-wise not (<code>~</code>) operator. </p> | ||
| <p>Due to the nature of logical operation result value, only the lowest bit could possibly be set, and it is unlikely to be intent in bitwise operations. Violations are often indicative of a typo, using a logical-not (<code>!</code>) operator instead of the bit-wise not (<code>~</code>) operator. </p> | ||
| <p>This rule is restricted to analyze bit-wise and (<code>&</code>) and bit-wise or (<code>|</code>) operation in order to provide better precision.</p> | ||
| <p>This rule ignores instances where a double negation (<code>!!</code>) is explicitly used as the opeartor of the bitwise operation, as this is a commonly used as a mechanism to normalize an integer value to either 1 or 0.</p> | ||
| <p>This rule ignores instances where a double negation (<code>!!</code>) is explicitly used as the operator of the bitwise operation, as this is a commonly used as a mechanism to normalize an integer value to either 1 or 0.</p> | ||
| <p>NOTE: It is not recommended to use this rule in kernel code or older C code as it will likely find several false positive instances.</p> | ||
|
Comment on lines
9
to
12
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This gave me a headache, since the file is in a directory named
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for digging into this. |
||
|
|
||
| </overview> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,12 @@ | |
| <overview> | ||
| <p> | ||
| Some header files, such as those which define structures or classes, cannot be included more than once within a translation unit, as doing so would | ||
| cause a redefinition error. Such headers must be guarded to prevent ill-effects from multiple inclusion. Simlarly, if header files include other | ||
| cause a redefinition error. Such headers must be guarded to prevent ill-effects from multiple inclusion. Similarly, if header files include other | ||
| header files, and this inclusion graph contains a cycle, then at least one file within the cycle must contain header guards in order to break the | ||
| cycle. Because of cases like these, all headers should be guarded as a matter of good practice, even if they do not strictly need to be. | ||
| </p> | ||
| <p> | ||
| Furthermore, most modern compilers contain optimisations which are triggered by header guards. If the header guard strictly conforms to the pattern | ||
| Furthermore, most modern compilers contain optimizations which are triggered by header guards. If the header guard strictly conforms to the pattern | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is |
||
| that compilers expect, then inclusions of that header other than the first have absolutely no effect: the file isn't re-read from disk, nor is it | ||
| re-tokenised or re-preprocessed. This can result in a noticeable, albeit minor, improvement to compilation time. | ||
| </p> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ more difficult to change which implementation you are using at a later date.</p> | |
| </example> | ||
| <references> | ||
|
|
||
| <li>C# Corner, <a href="http://www.c-sharpcorner.com/UploadFile/rmcochran/csharp_interrfaces03052006095933AM/csharp_interrfaces.aspx">C# Interface Based Development</a>.</li> | ||
| <li>C# Corner, <a href="https://www.c-sharpcorner.com/article/C-Sharp-interface-based-development/">C# Interface Based Development</a>.</li> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just me happily following a redirect which coincidentally fixes the typo check-spelling complained about. As a bonus, it changes an |
||
|
|
||
| </references> | ||
| </qhelp> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,7 +120,7 @@ func main() { | |
| } | ||
| }) | ||
| http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| // OK-ish: the input origin header is validated agains a whitelist. | ||
| // OK-ish: the input origin header is validated against a whitelist. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've mostly skipped |
||
| responseHeader := w.Header() | ||
| { | ||
| origin := req.Header.Get("origin") | ||
|
|
@@ -137,7 +137,7 @@ func main() { | |
| }) | ||
| http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| originSuffix := ".example.com" | ||
| // OK-ish: the input origin header is validated agains a suffix. | ||
| // OK-ish: the input origin header is validated against a suffix. | ||
| origin := req.Header.Get("Origin") | ||
| if origin != "" && (originSuffix == "" || strings.HasSuffix(origin, originSuffix)) { | ||
| w.Header().Set("Access-Control-Allow-Origin", origin) | ||
|
|
@@ -152,7 +152,7 @@ func main() { | |
| }) | ||
| http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| originSuffix := ".example.com" | ||
| // OK-ish: the input origin header is validated agains a whitelist. | ||
| // OK-ish: the input origin header is validated against a whitelist. | ||
| origin := req.Header.Get("Origin") | ||
| if origin != "" && (originSuffix == "" || AccessControlAllowOrigins[origin]) { | ||
| w.Header().Set("Access-Control-Allow-Origin", origin) | ||
|
|
@@ -166,7 +166,7 @@ func main() { | |
| } | ||
| }) | ||
| http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| // OK-ish: the input origin header is validated agains a whitelist. | ||
| // OK-ish: the input origin header is validated against a whitelist. | ||
| origin := req.Header.Get("origin") | ||
| if origin != "" && origin != "null" { | ||
| if len(AccessControlAllowOrigins) == 0 || AccessControlAllowOrigins[origin] { | ||
|
|
@@ -178,7 +178,7 @@ func main() { | |
| } | ||
| }) | ||
| // http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| // // OK-ish: the input origin header is validated agains a whitelist. | ||
| // // OK-ish: the input origin header is validated against a whitelist. | ||
| // origin := req.Header.Get("origin") | ||
| // if origin != "" && origin != "null" { | ||
| // if _, ok := AccessControlAllowOrigins[origin]; ok { | ||
|
|
@@ -190,7 +190,7 @@ func main() { | |
| // } | ||
| // }) | ||
| http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| // OK-ish: the input origin header is validated agains a whitelist. | ||
| // OK-ish: the input origin header is validated against a whitelist. | ||
| if origin := req.Header.Get("Origin"); cors[origin] { | ||
| w.Header().Set("Access-Control-Allow-Origin", origin) | ||
| } else if len(origin) > 0 && cors["*"] { | ||
|
|
@@ -202,7 +202,7 @@ func main() { | |
| w.Header().Set("Access-Control-Allow-Credentials", "true") | ||
| }) | ||
| http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { | ||
| // OK-ish: the input origin header is validated agains a whitelist. | ||
| // OK-ish: the input origin header is validated against a whitelist. | ||
| origin := req.Header.Get("origin") | ||
| for _, v := range GetAllowOrigin() { | ||
| if v == origin { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ func test() { | |
| http.HandleFunc("/ex5", func(w http.ResponseWriter, r *http.Request) { | ||
| untrustedInput := r.Referer() | ||
|
|
||
| // good as input is tested againt regex | ||
| // good as input is tested against regex | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, but a different spelling. And I don't think I'm actively ignoring |
||
| if m, _ := regexp.MatchString("ws://localhost:12345/*", untrustedInput); m { | ||
| nhooyr.Dial(context.TODO(), untrustedInput, nil) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,7 @@ For example: <code>PosixFilePermissions.asFileAttribute(EnumSet.of(PosixFilePerm | |
| </example> | ||
|
|
||
| <references> | ||
| <li>OSWAP: <a href="https://owasp.org/www-community/vulnerabilities/Insecure_Temporary_File">Insecure Temporary File</a>.</li> | ||
| <li>OWASP: <a href="https://owasp.org/www-community/vulnerabilities/Insecure_Temporary_File">Insecure Temporary File</a>.</li> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brand |
||
| <li>CERT: <a href="https://wiki.sei.cmu.edu/confluence/display/java/FIO00-J.+Do+not+operate+on+files+in+shared+directories">FIO00-J. Do not operate on files in shared directories</a>.</li> | ||
| </references> | ||
| </qhelp> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neither Git, GitHub, nor myself are fans of missing newline-at-eof. But I try not to change such things in PRs like this. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ Otherwise, a third-party application could impersonate the system this way to ca | |
|
|
||
| <recommendation> | ||
| <p> | ||
| In the <code>onReceive</code> method of a <code>BroadcastReciever</code>, the action of the received Intent should be checked. The following code demonstrates this. | ||
| In the <code>onReceive</code> method of a <code>BroadcastReceiver</code>, the action of the received Intent should be checked. The following code demonstrates this. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes the document agree w/ line 9... |
||
| </p> | ||
| <sample src="Good.java" /> | ||
| </recommendation> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this (and similar items) is (are) user facing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
.qhelpfiles are used to generate HTML, for example you can see this mistake here: https://codeql.github.com/codeql-query-help/cpp/cpp-unused-static-variable/