mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
This commit is contained in:
committed by
GitHub
parent
fea50065f5
commit
103c770ce7
@@ -52,9 +52,9 @@ class StringPartialMatchMethod extends Method {
|
|||||||
* The index of the parameter that is being matched against.
|
* The index of the parameter that is being matched against.
|
||||||
*/
|
*/
|
||||||
int getMatchParameterIndex() {
|
int getMatchParameterIndex() {
|
||||||
if not this.hasName("regionMatches")
|
if this.hasName("regionMatches")
|
||||||
then result = 0
|
then this.getParameterType(result) instanceof TypeString
|
||||||
else this.getParameterType(result) instanceof TypeString
|
else result = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import java
|
|||||||
private import semmle.code.java.frameworks.apache.Lang
|
private import semmle.code.java.frameworks.apache.Lang
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets Expr that return the value of `propertyName` from `System.getProperty()`.
|
* Gets an expression that retrieves the value of `propertyName` from `System.getProperty()`.
|
||||||
*/
|
*/
|
||||||
Expr getSystemProperty(string propertyName) {
|
Expr getSystemProperty(string propertyName) {
|
||||||
result = getSystemPropertyFromSystem(propertyName) or
|
result = getSystemPropertyFromSystem(propertyName) or
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ abstract class IsUnixGuard extends Guard { }
|
|||||||
abstract class IsAnyUnixGuard extends Guard { }
|
abstract class IsAnyUnixGuard extends Guard { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds when the MethodAccess is a call to check the current OS using either the upper case `osUpperCase` or lower case `osLowerCase` string constants.
|
* Holds when `ma` compares the current OS against the string constant `osString`.
|
||||||
*/
|
*/
|
||||||
bindingset[osString]
|
bindingset[osString]
|
||||||
private predicate isOsFromSystemProp(MethodAccess ma, string osString) {
|
private predicate isOsFromSystemProp(MethodAccess ma, string osString) {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ private class FileCreateTempFileSink extends FileCreationSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A guard that checks whether or not the the program is running on the Windows OS.
|
* A guard that holds when the program is definitely running under some version of Windows.
|
||||||
*/
|
*/
|
||||||
abstract private class WindowsOsBarrierGuard extends DataFlow::BarrierGuard { }
|
abstract private class WindowsOsBarrierGuard extends DataFlow::BarrierGuard { }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user