Lint Report: 14 warnings
Issue Types

Overview

Correctness
1warning DefaultLocale: Implied default locale in case conversion
6warning SimpleDateFormat: Implied locale in date format
1warning GradleDependency: Obsolete Gradle Dependency
1warning GradleDynamicVersion: Gradle Dynamic Version
Performance
5warning StaticFieldLeak: Static Field Leaks
Disabled Checks (33)

Implied default locale in case conversion

../../src/main/java/com/reactnative/googlefit/RecordingApi.java:64: Implicitly using the default locale is a common source of bugs: Use toUpperCase(Locale) instead. For strings meant to be internal use Locale.ROOT, otherwise Locale.getDefault().
  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: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
 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: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
 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: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
  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: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
 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: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
  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: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates.
 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: A newer version of com.android.tools.build:gradle than 3.3.1 is available: 3.5.0
  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: Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (com.facebook.react:react-native:+)
 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: This AsyncTask class should be static or leaks might occur (com.reactnative.googlefit.BodyHistory.DeleteDataTask)
 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: This AsyncTask class should be static or leaks might occur (com.reactnative.googlefit.BodyHistory.InsertAndVerifyDataTask)
 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: This AsyncTask class should be static or leaks might occur (com.reactnative.googlefit.CalorieHistory.InsertAndVerifyDataTask)
 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: This AsyncTask class should be static or leaks might occur (com.reactnative.googlefit.HeartrateHistory.DeleteDataTask)
 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: This AsyncTask class should be static or leaks might occur (com.reactnative.googlefit.HeartrateHistory.InsertAndVerifyDataTask)
 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 @SuppressLint annotation in the Java code
2. With a tools:ignore attribute in the XML file
3. With a //noinspection comment in the source code
4. With ignore flags specified in the build.gradle file, as explained below
5. With a lint.xml configuration file in the project
6. With a lint.xml configuration file passed to lint via the --config flag
7. 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/path

For more information, see http://g.co/androidstudio/suppressing-lint-warnings