Skip to content

Commit 4fda3ca

Browse files
author
Mohammed Ezzat
committed
squid:S00117, squid:S1854 - Local variable and method parameter names should comply with a naming convention, Dead stores should be removed
1 parent 29291fc commit 4fda3ca

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

app/src/main/java/com/tzutalin/vision/demo/Camera2BasicFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ private void captureStillPicture() {
755755
int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
756756
captureBuilder.set(CaptureRequest.JPEG_ORIENTATION, ORIENTATIONS.get(rotation));
757757

758-
CameraCaptureSession.CaptureCallback CaptureCallback
758+
CameraCaptureSession.CaptureCallback captureCallback
759759
= new CameraCaptureSession.CaptureCallback() {
760760

761761
@Override
@@ -782,7 +782,7 @@ public void onCaptureCompleted(@NonNull CameraCaptureSession session,
782782
};
783783

784784
mCaptureSession.stopRepeating();
785-
mCaptureSession.capture(captureBuilder.build(), CaptureCallback, null);
785+
mCaptureSession.capture(captureBuilder.build(), captureCallback, null);
786786
} catch (CameraAccessException e) {
787787
e.printStackTrace();
788788
}

app/src/main/java/com/tzutalin/vision/demo/ObjectDetectActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ protected void onPreExecute() {
9595
@Override
9696
protected List<VisionDetRet> doInBackground(String... strings) {
9797
final String filePath = strings[0];
98-
long startTime = 0;
99-
long endTime = 0;
98+
long startTime;
99+
long endTime;
100100
Log.d(TAG, "DetectTask filePath:" + filePath);
101101
if (mObjectDet == null) {
102102
try {

app/src/main/java/com/tzutalin/vision/demo/SceneRecognitionActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ protected void onPreExecute() {
124124
@Override
125125
protected List<VisionDetRet> doInBackground(String... strings) {
126126
initCaffeMobile();
127-
long startTime = 0;
128-
long endTime = 0;
127+
long startTime;
128+
long endTime;
129129
final String filePath = strings[0];
130130
List<VisionDetRet> rets = new ArrayList<>();
131131
Log.d(TAG, "PredictTask filePath:" + filePath);

cnnlibs/src/main/java/com/tzutalin/vision/visionrecognition/SceneClassifier.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public List<VisionDetRet> classifyByPath(String imgPath) {
7878
float[] propArray = jniClassifyImgByPath(imgPath);
7979
if (propArray != null) {
8080
Map<String, Float> sortedmap = Utils.sortPrediction(mSynsets, propArray);
81-
int k_size = 10;
81+
int kSize = 10;
8282
for (String key : sortedmap.keySet()) {
8383
VisionDetRet det = new VisionDetRet(key, sortedmap.get(key), 0, 0, 0, 0);
8484
ret.add(det);
85-
if (k_size == ret.size())
85+
if (kSize == ret.size())
8686
break;
8787
}
8888
}
@@ -114,11 +114,11 @@ public List<VisionDetRet> classify(Bitmap bitmap) {
114114
float[] propArray = jniClassifyBitmap(_handler);
115115
if (propArray != null) {
116116
Map<String, Float> sortedmap = Utils.sortPrediction(mSynsets, propArray);
117-
int k_size = 10;
117+
int kSize = 10;
118118
for (String key : sortedmap.keySet()) {
119119
VisionDetRet det = new VisionDetRet(key, sortedmap.get(key), 0, 0, 0, 0);
120120
ret.add(det);
121-
if (k_size == ret.size())
121+
if (kSize == ret.size())
122122
break;
123123
}
124124
}

0 commit comments

Comments
 (0)