Overview
| Correctness | |
| 1 | warning DefaultLocale: Implied default locale in case conversion |
| 6 | warning SimpleDateFormat: Implied locale in date format |
| 1 | warning GradleDependency: Obsolete Gradle Dependency |
| 1 | warning GradleDynamicVersion: Gradle Dynamic Version |
| Performance | |
| 5 | warning StaticFieldLeak: Static Field Leaks |
| Disabled Checks (33) |
Implied default locale in case conversion
../../src/main/java/com/reactnative/googlefit/RecordingApi.java:64:
61 } 62 63 public static String getEventName(String dataTypeName) { 64 return dataTypeName.toUpperCase() + "_RECORDING"; 65 } 66 67 public RecordingApi (ReactContext reactContext, GoogleFitManager googleFitManager) {
DefaultLocale
Correctness
Warning
Priority 6/10
Implied locale in date format
../../src/main/java/com/reactnative/googlefit/BodyHistory.java:241:
238 239 private void processDataSet(DataSet dataSet, WritableArray map) { 240 //Log.i(TAG, "Data returned for Data type: " + dataSet.getDataType().getName()); 241 Format formatter = new SimpleDateFormat("EEE"); 242 243 WritableMap stepMap = Arguments.createMap();../../src/main/java/com/reactnative/googlefit/CalorieHistory.java:139:
136 Log.i(TAG, "Data returned for Data type: " + dataSet.getDataType().getName()); 137 DateFormat dateFormat = DateFormat.getDateInstance(); 138 DateFormat timeFormat = DateFormat.getTimeInstance(); 139 Format formatter = new SimpleDateFormat("EEE"); 140 WritableMap stepMap = Arguments.createMap(); 141../../src/main/java/com/reactnative/googlefit/DistanceHistory.java:96:
93 Log.i(TAG, "Data returned for Data type: " + dataSet.getDataType().getName()); 94 DateFormat dateFormat = DateFormat.getDateInstance(); 95 DateFormat timeFormat = DateFormat.getTimeInstance(); 96 Format formatter = new SimpleDateFormat("EEE"); 97 98 WritableMap stepMap = Arguments.createMap();../../src/main/java/com/reactnative/googlefit/HeartrateHistory.java:225:
222 private void processDataSet(DataSet dataSet, WritableArray map) { 223 224 //Log.i(TAG, "Data returned for Data type: " + dataSet.getDataType().getName()); 225 Format formatter = new SimpleDateFormat("EEE"); 226 // WritableMap stepMap = Arguments.createMap(); 227 228 for (DataPoint dp : dataSet.getDataPoints()) {../../src/main/java/com/reactnative/googlefit/StepHistory.java:64:
61 62 public void aggregateDataByDate(long startTime, long endTime, final Callback successCallback) { 63 64 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); 65 dateFormat.setTimeZone(TimeZone.getDefault()); 66 67 Log.i(TAG, "Range Start: " + dateFormat.format(startTime));../../src/main/java/com/reactnative/googlefit/StepHistory.java:271:
268 private void processDataSet(DataSet dataSet, WritableArray map) { 269 //Log.i(TAG, "Data returned for Data type: " + dataSet.getDataType().getName()); 270 271 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); 272 dateFormat.setTimeZone(TimeZone.getDefault()); 273 274 WritableMap stepMap = Arguments.createMap();
SimpleDateFormat
Correctness
Warning
Priority 6/10
Obsolete Gradle Dependency
../../build.gradle:10:
7 } 8 9 dependencies { 10 classpath 'com.android.tools.build:gradle:3.3.1' 11 } 12 }
GradleDependency
Correctness
Warning
Priority 4/10
Gradle Dynamic Version
../../build.gradle:37:
34 35 dependencies { 36 implementation fileTree(include: ['*.jar'], dir: 'libs') 37 implementation 'com.facebook.react:react-native:+' 38 implementation "com.google.android.gms:play-services-auth:${safeExtGet('authVersion', '+')}" 39 implementation "com.google.android.gms:play-services-fitness:${safeExtGet('fitnessVersion', '+')}" 40 }
GradleDynamicVersion
Correctness
Warning
Priority 4/10
Static Field Leaks
../../src/main/java/com/reactnative/googlefit/BodyHistory.java:141:
138 } 139 140 //Async fit data delete 141 private class DeleteDataTask extends AsyncTask<Void, Void, Void> { 142 143 long startTime; 144 long endTime;../../src/main/java/com/reactnative/googlefit/BodyHistory.java:176:
173 174 175 //Async fit data insert 176 private class InsertAndVerifyDataTask extends AsyncTask<Void, Void, Void> { 177 178 private DataSet Dataset;../../src/main/java/com/reactnative/googlefit/CalorieHistory.java:190:
187 } 188 189 //Async fit data insert 190 private class InsertAndVerifyDataTask extends AsyncTask<Void, Void, Void> { 191 192 private DataSet FoodDataset;../../src/main/java/com/reactnative/googlefit/HeartrateHistory.java:124:
121 } 122 123 //Async fit data delete 124 private class DeleteDataTask extends AsyncTask<Void, Void, Void> { 125 126 long startTime; 127 long endTime;../../src/main/java/com/reactnative/googlefit/HeartrateHistory.java:159:
156 157 158 //Async fit data insert 159 private class InsertAndVerifyDataTask extends AsyncTask<Void, Void, Void> { 160 161 private DataSet Dataset;
StaticFieldLeak
Performance
Warning
Priority 6/10
Disabled Checks
One or more issues were not run by lint, either
because the check is not enabled by default, or because
it was disabled with a command line flag or via one or
more
lint.xml configuration files in the project directories.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:
1. With a
2. With a
3. With a //noinspection comment in the source code
4. With ignore flags specified in the
5. With a
6. With a
7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
To suppress a lint warning with a comment, add a
To suppress a lint warning in an XML file, add a
To suppress a lint warning in a
android {
lintOptions {
disable 'TypographyFractions','TypographyQuotes'
}
}
Here we specify a comma separated list of issue id's after the disable command. You can also use
To suppress lint warnings with a configuration XML file, create a file named
The format of the
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore everything in the test source set -->
<issue id="all">
<ignore path="*/test/*" />
</issue>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />
<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
<ignore regexp="(foo|bar).java" />
</issue>
<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>
<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
For more information, see http://g.co/androidstudio/suppressing-lint-warnings
1. With a
@SuppressLint annotation in the Java code2. With a
tools:ignore attribute in the XML file3. With a //noinspection comment in the source code
4. With ignore flags specified in the
build.gradle file, as explained below5. With a
lint.xml configuration file in the project6. With a
lint.xml configuration file passed to lint via the --config flag7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
@SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.To suppress a lint warning with a comment, add a
//noinspection id comment on the line before the statement with the error.To suppress a lint warning in an XML file, add a
tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:xmlns:tools="http://schemas.android.com/tools"To suppress a lint warning in a
build.gradle file, add a section like this:android {
lintOptions {
disable 'TypographyFractions','TypographyQuotes'
}
}
Here we specify a comma separated list of issue id's after the disable command. You can also use
warning or error instead of disable to change the severity of issues.To suppress lint warnings with a configuration XML file, create a file named
lint.xml and place it at the root directory of the module in which it applies.The format of the
lint.xml file is something like the following:<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore everything in the test source set -->
<issue id="all">
<ignore path="*/test/*" />
</issue>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />
<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
<ignore regexp="(foo|bar).java" />
</issue>
<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>
<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
$ lint --ignore UnusedResources,UselessLeaf /my/project/pathFor more information, see http://g.co/androidstudio/suppressing-lint-warnings