<commit_before>import fs                            from 'fs'
import glob                          from 'glob'
import linebyline                    from 'n-readlines'
import spawn                         from 'cross-spawn'

function listFiles(path) {
	return (glob
		.sync(path + '**')
		.filter(isFile)
		.filter(function(file){
			return getFilename(file).split('.')[1] === 'elm'
		}).filter(hasView).map(function(file) {
			return file.replace(path, '')
		})
	)
}

function generatePort(module_name) {
	var port_name = portName(module_name)
	return `
port ${port_name} : String
port ${port_name} =
    ${module_name}.view
        |> render`
}

function generateImport(module_name) {
	return `import ${module_name}`
}

function portName(module_name) {
	return module_name.replace('.','').toLowerCase()
}
<commit_msg>Clarify the code by using short functions<commit_after>import fs                            from 'fs'
import glob                          from 'glob'
import linebyline                    from 'n-readlines'
import spawn                         from 'cross-spawn'

function listFiles(path) {
	return (glob
		.sync(path + '**')
		.filter(isFile)
		.filter(file => getFilename(file).split('.')[1] === 'elm')
		.filter(hasView)
		.map(file => file.replace(path, ''))
	)
}

function generatePort(module_name) {
	var port_name = portName(module_name)
	return `
port ${port_name} : String
port ${port_name} =
    ${module_name}.view
        |> render`
}

function generateImport(module_name) {
	return `import ${module_name}`
}

function portName(module_name) {
	return module_name.replace('.','').toLowerCase()
}

{'fraction_non_alphanumeric': 0.1403076923076923, 'fraction_numerical': 0.0012307692307692308, 'mean_word_length': 2.729357798165138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4960567', 'n_tokens_mistral': 523, 'n_tokens_neox': 510, 'n_words': 107}