function analyze( files, options ) {
	var results;
	var nfiles;
	var opts;
	var file;
	var err;
	var acc;
	var dir;
	var i;
	if ( !isStringArray( files ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a list of file paths. Value: `%s`.', files ) );
	}
	nfiles = files.length;
	debug( 'Files: %s', files.join( ', ' ) );

	dir = cwd();
	debug( 'Current working directory: %s', dir );

	opts = {};
	opts.cumulative = defaults.cumulative;
	if ( arguments.length > 1 ) {
		err = validate( opts, options );
		if ( err ) {
			throw err;
		}
	}
	debug( 'Options: %s', JSON.stringify( opts ) );

	if ( opts.cumulative ) {
		acc = incrlloc();
	} else {
		results = [];
	}
	debug( 'Starting analysis of %d files...', nfiles );
	for ( i = 0; i < nfiles; i++ ) {
		debug( 'Reading file: %s (%d of %d)', files[ i ], i+1, nfiles );
		file = resolve( dir, files[ i ] );
		file = readFileSync( file, fopts );
		if ( file instanceof Error ) {
			debug( 'Encountered an error when reading file: %s (%d of %d). Error: %s', files[ i ], i+1, nfiles, file.message );
			return file;
		}
		debug( 'Successfully read file: %s (%d of %d).', files[ i ], i+1, nfiles );
		if ( opts.cumulative ) {
			debug( 'Updating cumulative summary...' );
			acc( file );
		} else {
			debug( 'Calculating LLOC...' );
			results.push( lloc( file ) );
		}
		debug( 'Finished analyzing file %d of %d.', i+1, nfiles );
	}
	if ( opts.cumulative ) {
		debug( 'Finished analysis. Returning cumulative results...' );
		return acc();
	}
	debug( 'Finished analysis. Returning results...' );
	return results;
}
Synchronously calculates logical lines of code (LLOC) for a list of JavaScript files.

@param {StringArray} files - list of files
@param {Options} [options] - function options
@param {boolean} [options.cumulative=true] - boolean indicating whether to perform a cumulative analysis
@throws {TypeError} first argument must be a list of file paths
@throws {TypeError} options argument must be an object
@throws {TypeError} must provide valid options
@returns {(Error|Object|NonNegativeIntegerArray)} analysis results or an error object

@example
var files = [ __filename ];

var results = analyze( files );
if ( results instanceof Error ) {
    throw results;
}
console.log( JSON.stringify( results ) );