From cade4f932dcc883366d533e4d22f4ac7c9d73dec Mon Sep 17 00:00:00 2001 From: Faisal Hameed Date: Thu, 10 Mar 2016 15:01:38 +0500 Subject: [PATCH] Fixing squid:S00117- Local variable and method parameter names should comply with a naming convention. --- .../schabi/newpipe/VideoInfoItemViewCreator.java | 16 ++++++++-------- .../schabi/newpipe/VideoItemDetailFragment.java | 4 ++-- .../schabi/newpipe/VideoItemListActivity.java | 6 +++--- .../org/schabi/newpipe/extractor/Parser.java | 8 ++++---- .../services/youtube/YoutubeStreamExtractor.java | 16 ++++++++-------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java b/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java index be189e2fb..5bb89e931 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java +++ b/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java @@ -102,15 +102,15 @@ class VideoInfoItemViewCreator { public TextView itemVideoTitleView, itemUploaderView, itemDurationView, itemUploadDateView, itemViewCountView; } - private String shortViewCount(Long view_count){ - if(view_count >= 1000000000){ - return Long.toString(view_count/1000000000)+"B views"; - }else if(view_count>=1000000){ - return Long.toString(view_count/1000000)+"M views"; - }else if(view_count>=1000){ - return Long.toString(view_count/1000)+"K views"; + private String shortViewCount(Long viewCount){ + if(viewCount >= 1000000000){ + return Long.toString(viewCount/1000000000)+"B views"; + }else if(viewCount>=1000000){ + return Long.toString(viewCount/1000000)+"M views"; + }else if(viewCount>=1000){ + return Long.toString(viewCount/1000)+"K views"; }else { - return Long.toString(view_count)+" views"; + return Long.toString(viewCount)+" views"; } } diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index 84d0dc21b..81b51da75 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -247,9 +247,9 @@ public class VideoItemDetailFragment extends Fragment { public void run() { Activity a = getActivity(); if(a != null) { - boolean show_age_restricted_content = PreferenceManager.getDefaultSharedPreferences(a) + boolean showAgeRestrictedContent = PreferenceManager.getDefaultSharedPreferences(a) .getBoolean(activity.getString(R.string.show_age_restricted_content), false); - if (streamInfo.age_limit == 0 || show_age_restricted_content) { + if (streamInfo.age_limit == 0 || showAgeRestrictedContent) { updateInfo(streamInfo); } else { onNotSpecifiedContentErrorWithMessage(R.string.video_is_age_restricted); diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java index 0d879149d..3814c60a5 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java @@ -272,14 +272,14 @@ public class VideoItemListActivity extends AppCompatActivity getSupportFragmentManager() .findFragmentById(R.id.videoitem_list)) .getListAdapter(); - String webpage_url = listAdapter.getVideoList().get((int) Long.parseLong(id)).webpage_url; + String webpageUrl = listAdapter.getVideoList().get((int) Long.parseLong(id)).webpage_url; if (mTwoPane) { // In two-pane mode, show the detail view in this activity by // adding or replacing the detail fragment using a // fragment transaction. Bundle arguments = new Bundle(); //arguments.putString(VideoItemDetailFragment.ARG_ITEM_ID, id); - arguments.putString(VideoItemDetailFragment.VIDEO_URL, webpage_url); + arguments.putString(VideoItemDetailFragment.VIDEO_URL, webpageUrl); arguments.putInt(VideoItemDetailFragment.STREAMING_SERVICE, currentStreamingServiceId); videoFragment = new VideoItemDetailFragment(); videoFragment.setArguments(arguments); @@ -298,7 +298,7 @@ public class VideoItemListActivity extends AppCompatActivity // for the selected item ID. Intent detailIntent = new Intent(this, VideoItemDetailActivity.class); //detailIntent.putExtra(VideoItemDetailFragment.ARG_ITEM_ID, id); - detailIntent.putExtra(VideoItemDetailFragment.VIDEO_URL, webpage_url); + detailIntent.putExtra(VideoItemDetailFragment.VIDEO_URL, webpageUrl); detailIntent.putExtra(VideoItemDetailFragment.STREAMING_SERVICE, currentStreamingServiceId); startActivity(detailIntent); } diff --git a/app/src/main/java/org/schabi/newpipe/extractor/Parser.java b/app/src/main/java/org/schabi/newpipe/extractor/Parser.java index 062d85d17..5ce1b5f0d 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/Parser.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/Parser.java @@ -54,11 +54,11 @@ public class Parser { public static Map compatParseMap(final String input) throws UnsupportedEncodingException { Map map = new HashMap<>(); for(String arg : input.split("&")) { - String[] split_arg = arg.split("="); - if(split_arg.length > 1) { - map.put(split_arg[0], URLDecoder.decode(split_arg[1], "UTF-8")); + String[] splitArg = arg.split("="); + if(splitArg.length > 1) { + map.put(splitArg[0], URLDecoder.decode(splitArg[1], "UTF-8")); } else { - map.put(split_arg[0], ""); + map.put(splitArg[0], ""); } } return map; diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java index 8574b71b4..978ae125f 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java @@ -435,14 +435,14 @@ public class YoutubeStreamExtractor extends StreamExtractor { public List getAudioStreams() throws ParsingException { Vector audioStreams = new Vector<>(); try{ - String encoded_url_map; + String encodedUrlMap; // playerArgs could be null if the video is age restricted if (playerArgs == null) { - encoded_url_map = videoInfoPage.get("adaptive_fmts"); + encodedUrlMap = videoInfoPage.get("adaptive_fmts"); } else { - encoded_url_map = playerArgs.getString("adaptive_fmts"); + encodedUrlMap = playerArgs.getString("adaptive_fmts"); } - for(String url_data_str : encoded_url_map.split(",")) { + for(String url_data_str : encodedUrlMap.split(",")) { // This loop iterates through multiple streams, therefor tags // is related to one and the same stream at a time. Map tags = Parser.compatParseMap( @@ -478,14 +478,14 @@ public class YoutubeStreamExtractor extends StreamExtractor { Vector videoStreams = new Vector<>(); try{ - String encoded_url_map; + String encodedUrlMap; // playerArgs could be null if the video is age restricted if (playerArgs == null) { - encoded_url_map = videoInfoPage.get("url_encoded_fmt_stream_map"); + encodedUrlMap = videoInfoPage.get("url_encoded_fmt_stream_map"); } else { - encoded_url_map = playerArgs.getString("url_encoded_fmt_stream_map"); + encodedUrlMap = playerArgs.getString("url_encoded_fmt_stream_map"); } - for(String url_data_str : encoded_url_map.split(",")) { + for(String url_data_str : encodedUrlMap.split(",")) { try { // This loop iterates through multiple streams, therefor tags // is related to one and the same stream at a time.