'Process file to determine if it is a JavaScript file and
if it is safe.
Arguments:
directory (string): The directory of the file to be checked
file_name (string): A filename for a potential JavaScript file
Returns:
The file results containing any violations.'

def process_file(self, directory, file_name):

    file_full_path = os.path.normpath(((directory + '/') + file_name))
    results = FileResults(file_full_path)
    if (not results.is_file):
        return results
    if (file_name.lower().endswith('.js') and (not file_name.lower().endswith('.min.js'))):
        skip_dirs = self._skip_javascript_dirs
    elif file_name.lower().endswith('.coffee'):
        skip_dirs = self._skip_coffeescript_dirs
    else:
        return results
    if (not self._is_valid_directory(skip_dirs, directory)):
        return results
    return self._load_and_check_file_is_safe(file_full_path, self.check_javascript_file_is_safe, results)
