<commit_before>package codereview

import testFixture.Fixture
import grails.converters.JSON

class ChangesetController {

    ScmAccessService scmAccessService

    def index() {
        def offset = "0"
        if(session.offset != null){
            session["offset"]   = "0"
        } else {
            session.setAttribute("offset", offset)
        }
        [offset: offset]
    }

    /**
     * TODO helper method for development phase
     */
    def initialCheckOut() {
        log.info("Checking out project.")
        scmAccessService.checkoutProject(Fixture.PROJECT_REPOSITORY_URL)
        redirect(action: "index", params: params)
    }

    def getLastChangesets = {
        render Changeset.list(max: 21, sort: "date", order: "desc") as JSON
    }

    def getFileNamesForChangeset = {      //needs id of changeset
        def changeset = Changeset.findById(params.id)
        def files = ProjectFile.findAllByChangeset(changeset)
        render files as JSON
    }

    def getNextTenChangesets = {
        def id = params.id
        def myOffset = id.toInteger() * 10 + 1
        render Changeset.list(max: 10, sort: "date", order: "desc", offset: myOffset) as JSON
    }

    def nextTenChangesets = {
        def offset = params.id
        [offset: offset]
    }

    def withComments = {           //experimental

    }
}

<commit_msg>TODO in ChangesetController<commit_after>package codereview

import testFixture.Fixture
import grails.converters.JSON

class ChangesetController {

    ScmAccessService scmAccessService

    def index() {
        def offset = "0"
        if(session.offset != null){          //TODO: change flag on method which compare this
            session["offset"]   = "0"        //TODO: change "0" and "offset" on variables
        } else {
            session.setAttribute("offset", offset)
        }
        [offset: offset]
    }

    /**
     * TODO helper method for development phase
     */
    def initialCheckOut() {
        log.info("Checking out project.")
        scmAccessService.checkoutProject(Fixture.PROJECT_REPOSITORY_URL)
        redirect(action: "index", params: params)
    }

    def getLastChangesets = {
        render Changeset.list(max: 21, sort: "date", order: "desc") as JSON
    }

    def getFileNamesForChangeset = {      //needs id of changeset
        def changeset = Changeset.findById(params.id)
        def files = ProjectFile.findAllByChangeset(changeset)
        render files as JSON
    }

    def getNextTenChangesets = {
        def id = params.id
        def myOffset = id.toInteger() * 10 + 1
        render Changeset.list(max: 10, sort: "date", order: "desc", offset: myOffset) as JSON
    }

    def nextTenChangesets = {       //TODO:refactor name getAnotherTenChangesets
        def offset = params.id
        [offset: offset]
    }

    def withComments = {           //experimental

    }
}


{'fraction_non_alphanumeric': 0.09733287149289921, 'fraction_numerical': 0.0065812261863526155, 'mean_word_length': 2.2413019079685745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6270280', 'n_tokens_mistral': 865, 'n_tokens_neox': 824, 'n_words': 216}