<commit_before>import { AggregationPipeline } from "./../aggregation-pipeline";
import { Pipe } from "../pipe";
import { ProjectInfo } from "@maxxton/microdocs-core/domain/common/project-info.model";

/**
 * Add all stored reports as input for the pipeline
 * @param pipe
 * @return {AggregationPipeline}
 */
export function takeEverything(pipe:Pipe<any>){
  pipe.projects.forEach( (projectInfo:ProjectInfo) => {
    projectInfo.getVersions().forEach((version:string) => {
      projectInfo.version = version;
      let report = pipe.reportRepo.getProject(pipe.env, projectInfo);
      pipe.result.pushProject(report);
    })
  });
}

/**
 * Add latest version(s) stored reports as input for the pipeline
 * @param pipe
 * @param versionAmount amount of versions per project
 * @return {AggregationPipeline}
 */
export function takeLatest(pipe:Pipe<any>, versionAmount:number):void{
  pipe.projects.forEach((projectInfo:ProjectInfo) => {
    var latestVersions = projectInfo.getVersions().reverse().slice(0, versionAmount);
    latestVersions.forEach((version:string) => {
      projectInfo.version = version;
      let report = pipe.reportRepo.getProject(pipe.env, projectInfo);
      pipe.result.pushProject(report);
    })
  });
}

<commit_msg>fix wrong version for check<commit_after>import { AggregationPipeline } from "./../aggregation-pipeline";
import { Pipe } from "../pipe";
import { ProjectInfo } from "@maxxton/microdocs-core/domain/common/project-info.model";

/**
 * Add all stored reports as input for the pipeline
 * @param pipe
 * @return {AggregationPipeline}
 */
export function takeEverything(pipe:Pipe<any>){
  pipe.projects.forEach( (projectInfo:ProjectInfo) => {
    projectInfo.getVersions().forEach((version:string) => {
      let info = projectInfo.getVersion(version);
      let report = pipe.reportRepo.getProject(pipe.env, info);
      pipe.result.pushProject(report);
    })
  });
}

/**
 * Add latest version(s) stored reports as input for the pipeline
 * @param pipe
 * @param versionAmount amount of versions per project
 * @return {AggregationPipeline}
 */
export function takeLatest(pipe:Pipe<any>, versionAmount:number):void{
  pipe.projects.forEach((projectInfo:ProjectInfo) => {
    var latestVersions = projectInfo.getVersions().reverse().slice(0, versionAmount);
    latestVersions.forEach((version:string) => {
      let info = projectInfo.getVersion(version);
      let report = pipe.reportRepo.getProject(pipe.env, info);
      pipe.result.pushProject(report);
    })
  });
}


{'fraction_non_alphanumeric': 0.1373015873015873, 'fraction_numerical': 0.0007936507936507937, 'mean_word_length': 4.398286937901499, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '5561718', 'n_tokens_mistral': 725, 'n_tokens_neox': 721, 'n_words': 158}