mizo0203/maikata-satellite-bot

View on GitHub

Showing 3 of 3 total issues

Method getDailyFav has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public StatusUpdate getDailyFav(Twitter twitter) throws TwitterException {
        TweetFav best = null;
        try {
            best = mOfy.getObjectById(TweetFav.class, "dairy");
        } catch (Exception e) {
Severity: Minor
Found in src/main/java/com/appspot/OIT_Maikata_Fan/Repository.java - About 1 hr to fix

    Method updateBestFav has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    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) {
    Severity: Minor
    Found in src/main/java/com/appspot/OIT_Maikata_Fan/UseCase.java - About 35 mins to fix

    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

        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()) {
    Severity: Minor
    Found in src/main/java/com/appspot/OIT_Maikata_Fan/Repository.java - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language