Analyze file source data for the case-insensitive phrase "Hello world".

@param {FileSourceData} fileSourceData - The file source data to analyze.
@returns {Analysis} - The analysis of the file source data.
338405
function analyze (fileSourceData) {
    var analysis = new Analysis();
        
    for (let sample of fileSourceData) {
        if (saysHelloWorld(sample.text)) {
            analysis.addError({
                line: sample.line,
                message: 'At least try to look like you didn\'t copy the demo code!'
            });
        }
    }

    return analysis;
}
1003776
function do_compile(file, name) {
		var name = name || file;
		if(!file) throw new Error("file not defined");
		if(_compiled[name]) return _compiled[name];
		var source = fs.readFileSync(file, "UTF-8");
		    _compiled[name] = dust.compile(source, name);
		if(_debug) console.log("[dustfs] [" + name + "] Template compiled from " + file);
		return _compiled[name];
	}
983789
function(file){

      // Sandboxed variables
      var filePath = '';
      // Read file source
      var src       = grunt.file.read(file);
      // Get file name
      var filename  = path.basename(file);
      // set file extention
      if(_opts.ext) {
        filename = filename.replace('.js', _opts.ext);
      }


      if(_opts.sourcemap){
        uglifyOpts.outSourceMap = filename + '.map';
        mapDest = _destPath + uglifyOpts.outSourceMap;
      }
      // Minify file source
      var result = uglify.minify(file, uglifyOpts);

      if(_opts.sourcemap){

        // Write source map to file
        grunt.file.write( mapDest, result.map );
      }

      var minSrc = result.code;

      // Verbose output by default for now
      if(_opts.verbose){

        grunt.log.ok(filename.yellow + ': original size: ' + String(src.length).cyan + ' bytes' + ', minified size: ' + String(minSrc.length).cyan + ' bytes.');
        if(_opts.sourcemap){
          grunt.log.ok('sourcemap generated to ' + uglifyOpts.outSourceMap.yellow);
        }
      } else {
        var _non_verbose_output = filename.yellow + ' minified';

        if(_opts.sourcemap){
          _non_verbose_output += ', and sourcemapped to ' + uglifyOpts.outSourceMap.yellow;
        }
        grunt.log.ok(_non_verbose_output);
      }





      // Set destination
      filePath = (_isMirrorSource) ? changeFilePath(file) : _destPath;
      minDest = filePath + filename;

      // Write minified sorce to destination file
      grunt.file.write( minDest, minSrc );

    }
961313
function main() {
  var inliner = this;
  var url = this.source;

  return fs.exists(this.filename || url)
  .then(function exists(isFile) {
    if (!isFile) {
      throw new Error('Not a file - use URL parser');
    }

    debug('inlining file');

    inliner.isFile = true;
    inliner.url = url; // this is a hack for the `resolve` function later on
    return inliner.get(this.filename || url, { encoding: 'binary' });
  })
  .catch(function isUrl() {
    // make the best guess as to whether we're working with a url
    if (inliner.url || url.indexOf('<') === -1) {
      url = inliner.url || inliner.source;
      // check for protocol on URL
      if (url.indexOf('http') !== 0) {
        url = 'http://' + url;
      }

      inliner.url = url;

      debug('inlining url');
      return inliner.get(url, { encoding: 'binary' });
    }

    // otherwise we're dealing with an inline string
    debug('inlining by string: ', inliner.source);
    inliner.isFile = true;
    inliner.url = '.';
    var res = {
      body: new Buffer(inliner.source),
      headers: {
        'content-type': 'text/html',
      },
    };
    return res;
  })
  .then(inliner.jobs.add('html'))
  .then(function processHTML(res) {
    inliner.jobs.done.html();
    debug('processing HTML');

    debug(inliner.options);

    var body;
    var cheerioLoadOptions = {};
    var enc = inliner.options.encoding;

    // try to determine the encoding from the headers and the body
    if (!enc) {
      enc = charset(res.headers, res.body);
      enc = enc || jschardet.detect(res.body).encoding.toLowerCase();
    }

    // normalise to avoid any mistakes
    if (enc === 'utf-8' || enc === 'utf8') {
      enc = 'utf-8';
    }

    cheerioLoadOptions.decodeEntities = false;
    if (enc !== 'utf-8') {
      debug('decoding from: %s', enc);
      body = iconv.encode(iconv.decode(res.body, enc), 'utf-8');
    } else {
      body = res.body;
    }

    body = body.toString();

    // if we spot some SVG elements in the source,
    // then we'll parse as XML to correctly get the SVG
    if (body.indexOf('<?xml') !== -1 ||
        body.indexOf('<?XML') !== -1) {
      cheerioLoadOptions.xmlMode = true;
    }

    if (body.indexOf('<svg') !== -1) {
      cheerioLoadOptions.lowerCaseAttributeNames = false;
    }

    var todo = inliner.findAssets(body, cheerioLoadOptions);
    var $ = todo.$;
    delete todo.$;

    if (enc !== 'utf-8') {
      // when transcoding remove any meta tags setting the charset
      $('meta').each(function charMeta() {
        var attrs = $(this).attr();
        var content = attrs.content || '';
        if (attrs.charset || content.toLowerCase().indexOf('charset=') !== -1) {
          $(this).remove();
        }
      });
    }

    var promises = [];

    forEach(todo, function forEach(todo, key) {
      if (key === 'images' && !inliner.options.images) {
        // skip images if the user doesn't want them
        delete todo.images;
        debug('skipping images');
        return;
      }

      if (key === 'videos' && !inliner.options.videos) {
        // skip videos if the user doesn't want them
        delete todo.videos;
        debug('skipping videos');
        return;
      }

      if (!todo.length) {
        return;
      }

      inliner.jobs.add(key, todo.length);

      var tasks = taskRunner[key](inliner, todo.get(), $);
      promises = promises.concat(tasks);
    });

    return Promise.all(promises).then(function then() {
      var html = '';

      // remove comments
      if (!inliner.options.preserveComments) {
        inliner.removeComments($(':root')[0], $);
      }

      // collapse the white space
      if (inliner.options.collapseWhitespace) {
        debug('collapsing whitespace');
        $('pre, textarea').each(function () {
          $(this).html($(this).html()
              .replace(/\n/g, '~~nl~~')
              .replace(/\s/g, '~~s~~'));
        });

        $('script').each(function () {
          $(this).text($(this).text()
              .replace(/\n/g, '~~nl~~')
              .replace(/\s/g, '~~s~~'));
        });

        html = $.html()
          .replace(/\s+/g, ' ')
          .replace(/~~nl~~/g, '\n')
          .replace(/~~s~~/g, ' ');
      } else {
        html = $.html();
      }

      debug('completed: %s bytes', html.length);

      return html;
    });

  })
  .then(function then(html) {
    inliner.callback(null, html);
    inliner.emit('end');
  })
  .catch(function errHandler(error) {
    debug('fail', error.stack);
    inliner.callback(error);
    inliner.emit('error', error);
    throw error;
  });
}
1033295
function normalizeData(data) {
  // Package.json
  if (data.buddy) data = data.buddy;
  // Handle super simple mode
  if (data.input) data = { build: [data] };
  return data;
}
646094
function getSourceCode(fileName) {
    return __awaiter(this, void 0, void 0, function () {
        var code, codeCommentsRegex, importsRegex, imports;
        var _this = this;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0: return [4 /*yield*/, readFile(fileName, 'utf-8')];
                case 1:
                    code = _a.sent();
                    codeCommentsRegex = /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g;
                    code = code.replace(codeCommentsRegex, '');
                    importsRegex = /import "([^"]*)";/g;
                    imports = matches(importsRegex, code);
                    return [4 /*yield*/, Promise.all(imports.map(function (match) { return __awaiter(_this, void 0, void 0, function () {
                            var p, innerCode;
                            return __generator(this, function (_a) {
                                switch (_a.label) {
                                    case 0:
                                        p = path.resolve(fileName, '..', match.inner);
                                        return [4 /*yield*/, getSourceCode(p)];
                                    case 1:
                                        innerCode = _a.sent();
                                        // remove first line containing version
                                        innerCode = innerCode.replace(/^.*\n/, '');
                                        code = code.replace(match.full, innerCode);
                                        return [2 /*return*/];
                                }
                            });
                        }); }))];
                case 2:
                    _a.sent();
                    return [2 /*return*/, code];
            }
        });
    });
}
665583
function(data) {
    var filePath = data.filePath;
    var noExtensionFilePath = data.noExtensionFilePath;
    var fileName = data.fileName;
    var noExtensionFileName = data.noExtensionFileName;

    return [
      "describe('" + noExtensionFilePath + "', function() {",
      "});",
    ].join('\n');
  }
803683
def analyse_source(pPath)
        @name = File.basename(pPath, ".*")
        @path = File.dirname(pPath)
        analyse_first_step(pPath)
        analyse_second_step
      end
741960
function parse( source ) {
      // Must use eval since Jasmine produces no valid JSON (unquoted object keys, Object constructor)
      try {
         // Because the source code is an expression generated by jasmine, newlines should only occur as part
         // of strings (the otherwise missing newlines are the reason that this fixup script exists).
         const oneLineSource = source.replace( '\n', NEWLINE_MARKER );
         // eslint-disable-next-line no-eval
         return eval( '[ ' + oneLineSource + ' ]' );
      }
      catch( e ) {
         var msg = 'webpack-jasmine-html-runner-plugin: fixup-json-messages: could not parse message part: ';
         // eslint-disable-next-line no-console
         console.info( msg, source );
         return source;
      }
   }
1282079
function (fileName) {
        var result = new _File(fileName),
            fileData = this._data[fileName];
        [{
            type: "statements",
            data: "s",
            map: "statementMap"
        }, {
            type: "functions",
            data: "f",
            map: "fnMap"
        }, {
            type: "branches",
            data: "b",
            map: "branchMap"
        }].forEach(function (part) {
            var map = fileData[part.map],
                data = fileData[part.data],
                statistics = result[part.type],
                index = 1;
            while (undefined !== data[index]) {
                statistics.processCoverage(data[index], map[index]);
                ++index;
            }
        });
        return result;
    }
1064644
function tableStructureFromStringData(stringData) {
    // sourceData can be either json (starts with a '[') or csv format (contains a true line feed or '\n'; \n is replaced with a real linefeed).
    if (!defined(stringData) || stringData.length < 2) {
      return;
    }
    // We prevent ALT, LON and LAT from being chosen, since we know this is a non-geo csv already.
    const result = new TableStructure("chart", {
      unallowedTypes: [VarType.ALT, VarType.LAT, VarType.LON]
    });
    if (stringData[0] === "[") {
      // Treat as json.
      const json = JSON.parse(stringData.replace(/&quot;/g, '"'));
      return TableStructure.fromJson(json, result);
    }
    if (stringData.indexOf("\\n") >= 0 || stringData.indexOf("\n") >= 0) {
      // Treat as csv.
      return TableStructure.fromCsv(stringData.replace(/\\n/g, "\n"), result);
    }
  }
399576
function() {
            if(this.isObjects === undefined) {
                this.isObjects = false;
                for(var i=0; i<this.sourceData.length; i++) {
                    if(this.sourceData[i].value !== this.sourceData[i].text) {
                        this.isObjects = true;
                        break;
                    } 
                }
            } 
            return this.isObjects;
        }
298638
def analyse_first_step(pPath)
        fileElement = Languages::FileElementData.new(pPath)
        @source = File.open(pPath, "rb")
        @source.each do |line|
          next if line.gsub(/\s+/,"").size == 0
          processedLines = handle_semicolon(line)
          if !processedLines.nil?
            processedLines.each do |line|
              @state.handle_line(line)
              fileElement = @state.execute(fileElement, line)
            end
          end
        end

        @source.close()
        @fileElements.push(fileElement)

      end
274754
function parse_markdown(file, options, callback) { 
  fs.readFile(file, 'utf8', function (err, source) {
    if (err) {
      callback(err);
      return;
    }
    var sourceLines = source.split("\n");
    var metaExpr = /\{(([\"\']).+\1\s*:\s*[\"\'].+\1)\}/g;
    var metaString;

    var firstClass = {
        found: false,
        name: ""
    };
    var re;

    if (re = sourceLines[0].match(/^\#{1}\s+(.+)/)) { // if #, it's a title
        var metaString = sourceLines[1].match(metaExpr);

        if (!metaString) {
            console.error("Error".red + ": on " + file + " you started with #, but provided no context--that's bad.");
            process.exit(1);
        }

        var metaJson = JSON.parse(metaString);

        if (metaJson.type == 'misc') {
            var title = sourceLines[0].substr(2).replace(/(\w) /g, "$1");
            sourceLines[0] = "/** section: " + title + "\n";
            sourceLines[1] = "* class " + title;

            for (l = 2; l < sourceLines.length; l++) {
                sourceLines[l] = "* " + sourceLines[l];
            }
            sourceLines.push("**/");
            return pdoc_parser("", {registered: true, source: sourceLines.join("\n"), file: file, options: options, callback: callback});
        }
        else {
            console.error("In " + file + " I did not understand the type '" + metaJson.type + "'");
        }
    }
    else if (re = sourceLines[0].match(/^\#{2}\s+(.+)/)) { // if ##, it's a class
        if (!firstClass.found) {
            firstClass.found = true;
            firstClass.name = re[1];
            sourceLines[0] = "/**\n* " + "class " + firstClass.name;
            if ( (metaString = sourceLines[1].match(metaExpr) ) ) {
                var metaString = metaString[0].replace("(", "").replace(")", "");
                sourceLines[0] = "/** " + metaString + "\n* " + "class " + firstClass.name;
                sourceLines[1] = "* ";
            }
            else
                sourceLines[1] = "* ";
        }
    }
    else {
        console.error("Error".red + ": first line in " + file + " is neither # or ##--that's bad.");
        process.exit(1);
    }

    for (var l = 2; l < sourceLines.length; l++) {
        if (re = sourceLines[l].match(/^\#{2}\s+(.+)/)) { // if ##, it's a class
            if (!firstClass.found) {
                firstClass.found = true;
                firstClass.name = re[1];
                sourceLines[l] = "/**\n* " + sourceLines[l].replace("##", "class " + firstClass.name);
            }
            else {
                if (re[1].indexOf("<") < 0) {
                    sourceLines[l] = "**/\n\n/**\n* " + "class " + re[1] + " < " + firstClass.name;
                }
                else {
                    sourceLines[l] = "**/\n\n/**\n* " + "class " + re[1];
                }
            }
        }
        else if (sourceLines[l].match(/^\#{3}\s+/)) { // if ###, it's a member
            var startingDefPos = l;
            sourceLines[l] = "**/\n\n/**\n* " + sourceLines[l].replace("###", "");
            var n = l + 1;

            while (sourceLines[n].match(/^\#{3}\s+/)) { // it has aliases
                sourceLines[n] = " " + sourceLines[n].replace("###", "");
                n++;
            }

            var tagRE = sourceLines[n].match(/^(\((.+)\))$/);
            if (tagRE) { // if it's got tags, add them appropriately to the starting /**
                sourceLines[l] = sourceLines[l].replace("/**", "/** " + tagRE[2]);
                sourceLines[n] = "";
                n++;
            }
           // while (sourceLines[n].match(/[-|*|+]\s*.+?\s*{.+?}\s*/)) {
             //   sourceLines[n] = sourceLines[n].replace("{", "(").replace("}", "):");
             /*   n++;
            } */
        }
        else { // catch tags after param lists
            var tagRE = sourceLines[l].match(/^(\((.+)\))$/);
            var indentedParam = sourceLines[l].match(/^\s+[*|-]/);
            
            if (tagRE) { // if it's got tags, add them appropriately to the starting /**
                sourceLines[startingDefPos] = sourceLines[startingDefPos].replace("/**", "/** " + tagRE[2]);
                sourceLines[l] = "";
            }
            else if (indentedParam) {
                // noop
            }
            else { // everything else just prefix with a "*"
                 sourceLines[l] = "*" + sourceLines[l];
            }
        }
    }

    sourceLines.push("**/");

    pdoc_parser("", {registered: true, source: sourceLines.join("\n"), file: file, options: options, callback: callback});
  });
}
317612
function fileChecks( filepath )
		{
			// check if file exists
			if (!grunt.file.exists(filepath))
			{
				grunt.log.warn('Source file "' + filepath + '" not found');
				return false;
			}

			if(options.checkFilesize)
			{
				// check for size
				var stats = fs.lstatSync( filepath );

				if(stats.size > UNCRITICAL_FILE_SIZE)
				{
					grunt.log.warn('uncritical datauri size (' + filesize(UNCRITICAL_FILE_SIZE) + ') exceeded: ' + filepath + ' (' + filesize(stats.size) + ')');
				}
			}

			return true;
		}
1328594
function(sourceOrProgram, filename) {
        
        if (!(this instanceof MetaScript)) {
            __version = Array.prototype.join.call(arguments, '.');
            return;
        }
        
        // Whether constructing from a meta program or, otherwise, a source
        var isProgram = (sourceOrProgram+="").substring(0, 11) === 'MetaScript(';
        
        /**
         * Original source.
         * @type {?string}
         */
        this.source = isProgram ? null : sourceOrProgram;

        /**
         * Original source file name.
         * @type {string}
         */
        this.filename = filename || "main";

        /**
         * The compiled meta program's source.
         * @type {string}
         */
        this.program = isProgram ? sourceOrProgram : MetaScript.compile(sourceOrProgram);
    }
93223
public static void generateSource(String data, File sourceOutputPath) {
        ProtoFile protoFile = ProtoParser.parse(DEFAULT_FILE_NAME, data);
        List<CodeDependent> cds = new ArrayList<CodeDependent>();
        try {
            doCreate(protoFile, true, false, null, true, sourceOutputPath, cds, new HashMap<String, String>(), false);
        } catch (IOException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }