Skip to content

Commit

Permalink
lint-fix: automatically fix the new issues introduced by the ts-eslin…
Browse files Browse the repository at this point in the history
…t `indent` rule
  • Loading branch information
EagleoutIce committed Aug 18, 2023
1 parent 61dcfe4 commit 645feae
Show file tree
Hide file tree
Showing 82 changed files with 892 additions and 892 deletions.
10 changes: 5 additions & 5 deletions src/benchmark/slicer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ import { MergeableRecord } from '../util/objects'
export const benchmarkLogger = log.getSubLogger({ name: "benchmark" })

export interface BenchmarkSlicerStats extends MergeableRecord {
stats: SlicerStats
tokenMap: Record<string, string>
normalizedAst: RExpressionList
decoratedAst: DecoratedAst
dataflow: DataflowInformation
stats: SlicerStats
tokenMap: Record<string, string>
normalizedAst: RExpressionList
decoratedAst: DecoratedAst
dataflow: DataflowInformation
}

/**
Expand Down
38 changes: 19 additions & 19 deletions src/benchmark/stats/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ export type PerSliceMeasurements = typeof PerSliceMeasurements[number]
export type ElapsedTime = bigint

export interface PerSliceStats {
measurements: Map<PerSliceMeasurements, ElapsedTime>
slicingCriteria: { criterion: SingleSlicingCriterion, id: NodeId }[]
reconstructedCode: ReconstructionResult
numberOfDataflowNodesSliced: number
timesHitThreshold: number
measurements: Map<PerSliceMeasurements, ElapsedTime>
slicingCriteria: { criterion: SingleSlicingCriterion, id: NodeId }[]
reconstructedCode: ReconstructionResult
numberOfDataflowNodesSliced: number
timesHitThreshold: number
}

export interface SlicerStatsInput<T = number> {
numberOfLines: T
numberOfCharacters: T
numberOfNonWhitespaceCharacters: T
numberOfRTokens: T
numberOfNormalizedTokens: T
numberOfLines: T
numberOfCharacters: T
numberOfNonWhitespaceCharacters: T
numberOfRTokens: T
numberOfNormalizedTokens: T
}


export interface SlicerStatsDataflow<T = number> {
numberOfNodes: T
numberOfEdges: T
numberOfCalls: T
numberOfFunctionDefinitions: T
numberOfNodes: T
numberOfEdges: T
numberOfCalls: T
numberOfFunctionDefinitions: T
}

/**
* The statistics that are collected by the {@link BenchmarkSlicer} and used for benchmarking.
*/
export interface SlicerStats {
commonMeasurements: Map<CommonSlicerMeasurements, ElapsedTime>
perSliceMeasurements: Map<SlicingCriteria, PerSliceStats>
request: RParseRequestFromFile | RParseRequestFromText
input: SlicerStatsInput
dataflow: SlicerStatsDataflow
commonMeasurements: Map<CommonSlicerMeasurements, ElapsedTime>
perSliceMeasurements: Map<SlicingCriteria, PerSliceStats>
request: RParseRequestFromFile | RParseRequestFromText
input: SlicerStatsInput
dataflow: SlicerStatsDataflow
}
92 changes: 46 additions & 46 deletions src/benchmark/stats/summarizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,56 @@ import { log } from '../../util/log'
const tempfile = tmp.fileSync({ postfix: '.R' })

export interface SummarizedMeasurement {
min: number
max: number
median: number
/** average */
mean: number
/** standard deviation */
std: number
min: number
max: number
median: number
/** average */
mean: number
/** standard deviation */
std: number
}

interface SliceSizeCollection {
lines: number[]
characters: number[]
nonWhitespaceCharacters: number[]
/** like library statements during reconstruction */
autoSelected: number[]
dataflowNodes: number[]
tokens: number[]
normalizedTokens: number[]
lines: number[]
characters: number[]
nonWhitespaceCharacters: number[]
/** like library statements during reconstruction */
autoSelected: number[]
dataflowNodes: number[]
tokens: number[]
normalizedTokens: number[]
}

/**
* @see SlicerStats
* @see summarizeSlicerStats
*/
export type SummarizedSlicerStats = {
perSliceMeasurements: SummarizedPerSliceStats
perSliceMeasurements: SummarizedPerSliceStats
} & Omit<SlicerStats, 'perSliceMeasurements'>

export interface Reduction<T = number> {
numberOfLines: T
numberOfLinesNoAutoSelection: T
numberOfCharacters: T
numberOfNonWhitespaceCharacters: T
numberOfRTokens: T
numberOfNormalizedTokens: T
numberOfDataflowNodes: T
numberOfLines: T
numberOfLinesNoAutoSelection: T
numberOfCharacters: T
numberOfNonWhitespaceCharacters: T
numberOfRTokens: T
numberOfNormalizedTokens: T
numberOfDataflowNodes: T
}

export interface SummarizedPerSliceStats {
/** number of total slicing calls */
numberOfSlices: number
/** statistics on the used slicing criteria (number of ids within criteria etc.) */
sliceCriteriaSizes: SummarizedMeasurement
measurements: Map<PerSliceMeasurements, SummarizedMeasurement>
reduction: Reduction<SummarizedMeasurement>
failedToRepParse: number
timesHitThreshold: number
sliceSize: {
[K in keyof SliceSizeCollection]: SummarizedMeasurement
}
/** number of total slicing calls */
numberOfSlices: number
/** statistics on the used slicing criteria (number of ids within criteria etc.) */
sliceCriteriaSizes: SummarizedMeasurement
measurements: Map<PerSliceMeasurements, SummarizedMeasurement>
reduction: Reduction<SummarizedMeasurement>
failedToRepParse: number
timesHitThreshold: number
sliceSize: {
[K in keyof SliceSizeCollection]: SummarizedMeasurement
}
}

function safeDivPercentage(a: number, b: number): number | undefined{
Expand All @@ -96,7 +96,7 @@ function safeDivPercentage(a: number, b: number): number | undefined{
}

function calculateReductionForSlice(input: SlicerStatsInput, dataflow: SlicerStatsDataflow, perSlice: {
[k in keyof SliceSizeCollection]: number
[k in keyof SliceSizeCollection]: number
}): Reduction<number | undefined> {
return {
numberOfLines: safeDivPercentage(perSlice.lines, input.numberOfLines),
Expand Down Expand Up @@ -259,17 +259,17 @@ export function summarizeSummarizedMeasurement(data: SummarizedMeasurement[]): S


export interface UltimateSlicerStats {
totalRequests: number
totalSlices: number
commonMeasurements: Map<CommonSlicerMeasurements, SummarizedMeasurement>
perSliceMeasurements: Map<PerSliceMeasurements, SummarizedMeasurement>
/** sum */
failedToRepParse: number
/** sum */
timesHitThreshold: number
reduction: Reduction<SummarizedMeasurement>
input: SlicerStatsInput<SummarizedMeasurement>
dataflow: SlicerStatsDataflow<SummarizedMeasurement>
totalRequests: number
totalSlices: number
commonMeasurements: Map<CommonSlicerMeasurements, SummarizedMeasurement>
perSliceMeasurements: Map<PerSliceMeasurements, SummarizedMeasurement>
/** sum */
failedToRepParse: number
/** sum */
timesHitThreshold: number
reduction: Reduction<SummarizedMeasurement>
input: SlicerStatsInput<SummarizedMeasurement>
dataflow: SlicerStatsDataflow<SummarizedMeasurement>
}

export function summarizeAllSummarizedStats(stats: SummarizedSlicerStats[]): UltimateSlicerStats {
Expand Down
4 changes: 2 additions & 2 deletions src/benchmark/stopwatch.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { guard } from '../util/assert'

export interface IStoppableStopwatch {
/** Stop the given stopwatch. */
stop(): void
/** Stop the given stopwatch. */
stop(): void
}

/** unguarded start-stop wrapper */
Expand Down
14 changes: 7 additions & 7 deletions src/cli/benchmark-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export const optionDefinitions: OptionDefinition[] = [
]

export interface BenchmarkCliOptions {
verbose: boolean
help: boolean
input: string[]
output: string
slice: string
parallel: number
limit?: number
verbose: boolean
help: boolean
input: string[]
output: string
slice: string
parallel: number
limit?: number
}

export const optionHelp = [
Expand Down
10 changes: 5 additions & 5 deletions src/cli/benchmark-helper-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export const optionDefinitions: OptionDefinition[] = [
]

export interface SingleBenchmarkCliOptions {
verbose: boolean
help: boolean
input?: string
slice: string
output?: string
verbose: boolean
help: boolean
input?: string
slice: string
output?: string
}

export const optionHelp = [
Expand Down
10 changes: 5 additions & 5 deletions src/cli/export-quads-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const optionDefinitions: OptionDefinition[] = [
]

export interface QuadsCliOptions {
verbose: boolean
help: boolean
input: string[]
limit: number
output: string | undefined
verbose: boolean
help: boolean
input: string[]
limit: number
output: string | undefined
}

export const optionHelp = [
Expand Down
14 changes: 7 additions & 7 deletions src/cli/slicer-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export const optionDefinitions: OptionDefinition[] = [
]

export interface SlicerCliOptions {
verbose: boolean
help: boolean
input: string | undefined
criterion: string | undefined
output: string | undefined
stats: boolean
// dataflow: boolean
verbose: boolean
help: boolean
input: string | undefined
criterion: string | undefined
output: string | undefined
stats: boolean
// dataflow: boolean
}

export const optionHelp = [
Expand Down
14 changes: 7 additions & 7 deletions src/cli/summarizer-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export const optionDefinitions: OptionDefinition[] = [
]

export interface BenchmarkCliOptions {
verbose: boolean
help: boolean
'ultimate-only': boolean
input?: string
output?: string
verbose: boolean
help: boolean
'ultimate-only': boolean
input?: string
output?: string
}

export const optionHelp = [
Expand All @@ -53,8 +53,8 @@ export const optionHelp = [


interface BenchmarkData {
filename: string,
stats: SlicerStats
filename: string,
stats: SlicerStats
}

const options = commandLineArgs(optionDefinitions) as BenchmarkCliOptions
Expand Down
Loading

0 comments on commit 645feae

Please sign in to comment.