Showing 3 of 3 total issues
Method getDailyFav
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public StatusUpdate getDailyFav(Twitter twitter) throws TwitterException {
TweetFav best = null;
try {
best = mOfy.getObjectById(TweetFav.class, "dairy");
} catch (Exception e) {
Method updateBestFav
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
private void updateBestFav(Twitter twitter, List<Long> ids) {
LOG.info("ids.size(): " + ids.size() + "\n" + "ids: " + ids);
Status status_favmax = null;
int tmp = -1;
for (long id : ids) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getHomeTimeline
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public void getHomeTimeline(Twitter twitter, List<Status> dest) throws TwitterException {
long sinceId = getSinceId(twitter);
Paging paging = new Paging(1, 200, sinceId);
ResponseList<Status> statuses = twitter.getHomeTimeline(paging);
if (!statuses.isEmpty()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"