Skip to content

Commit

Permalink
saving
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Sep 12, 2024
1 parent 4c9e0da commit 9f8bcf7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ClpArchiveDecoder implements Decoder {
* invoked publicly. Instead, use ClpArchiveDecoder.create() to create a
* new instance of the class.
*
* @param dataInputStream Byte stream containing segment data with offset
* @param dataInputStream Byte array containing single file archive with offset
* at start of segments.
* @param segmentSizes Byte sizes for segments.
* @param segmentInfos Metadata for segments.
Expand All @@ -59,13 +59,11 @@ class ClpArchiveDecoder implements Decoder {
}

Check failure on line 59 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L59

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

/**

Check failure on line 61 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L61

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
* Creates a new ClpArchiveDecoder. Deserializes the single archive header,
* the CLP archive metadata, and the archive dictionaries. The returned
* decoder is in a state to deserialize segment data.
* Creates a new ClpArchiveDecoder. Deserializes the single archive header
* metadata, the CLP archive metadata, and the archive dictionaries. The
* returned decoder state is ready to deserialize segment data.
*
* @param dataArray Byte array containing single file archive. When this
* method returns, the position of the data array will be the start of
* segment data.
* @param dataArray Byte array containing single file archive.
* @return A Promise that resolves to the created ClpArchiveDecoder instance.
*/
static async create (dataArray: Uint8Array): Promise<ClpArchiveDecoder> {

Check failure on line 69 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L69

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
Expand All @@ -80,7 +78,7 @@ class ClpArchiveDecoder implements Decoder {

const segmentInfos: SegmentInfo[] = await querySegmentInfos(

Check failure on line 79 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L79

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
dataInputStream,

Check failure on line 80 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L80

[@stylistic/js/indent] Expected indentation of 12 spaces but found 8.
nonSegmentSizes.metadataDB
nonSegmentSizes.metadataDb

Check failure on line 81 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L81

[@stylistic/js/indent] Expected indentation of 12 spaces but found 8.
);

Check failure on line 82 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L82

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

const logTypeDict: Uint8Array[] = await ClpArchiveDecoder.#deserializeDictionary(

Check failure on line 84 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L84

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
Expand Down Expand Up @@ -152,10 +150,9 @@ class ClpArchiveDecoder implements Decoder {
throw new Error("Log event at index ${logEventIdx} does not exist");

Check failure on line 150 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L150

[@stylistic/js/indent] Expected indentation of 16 spaces but found 8.

Check failure on line 150 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L150

[no-template-curly-in-string] Unexpected template string expression.
}

Check failure on line 151 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L151

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.

const message: string = toMessage(logEvent, textDecoder);
const logLevel: LOG_LEVEL = logEvent.logLevel;

Check failure on line 153 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L153

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.

Check failure on line 153 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L153

[prefer-destructuring] Use object destructuring.
const timestamp: bigint = logEvent.timestamp;

Check failure on line 154 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L154

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.

Check failure on line 154 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L154

[prefer-destructuring] Use object destructuring.

const message: string = toMessage(logEvent, textDecoder);

Check failure on line 155 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L155

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.
results.push([message, Number(timestamp), logLevel, logEventIdx + 1]);

Check failure on line 156 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L156

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.

Check failure on line 156 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L156

[@stylistic/js/array-element-newline] There should be a linebreak after this element.

Check failure on line 156 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L156

[@stylistic/js/array-element-newline] There should be a linebreak after this element.

Check failure on line 156 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L156

[@stylistic/js/array-element-newline] There should be a linebreak after this element.
}

Check failure on line 157 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/ClpArchiveDecoder.ts#L157

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Placeholder} from "../../../typings/placeholder";
dayjs.extend(bigIntSupport);

Check warning on line 7 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/logevent.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/logevent.ts#L7

[import/no-named-as-default-member] Caution: `dayjs` also has a named export `extend`. Check if you meant to write `import {extend} from 'dayjs'` instead.

/**
* IR-like logEvent retrieved from CLP archive.
* IR-like log event retrieved from CLP archive.
*/
interface ArchiveLogEvent {
timestamp: bigint;
Expand Down
26 changes: 13 additions & 13 deletions new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ type SegmentFileSizes = number[];
* Byte sizes for non-segment archive files.
*/
interface NonSegmentFileSizes {
metadataDB: number;
metadataDb: number;
logTypeDict: number;
logTypeSegIndex: number;
varDict: number;
varSegIndex: number;
}

/**
* Segment Metadata.
* Segment metadata.
*/
interface SegmentInfo {
numMessages: number;
Expand Down Expand Up @@ -72,28 +72,28 @@ const deserializeHeaderMetadata = (
};

/**
* Parse single file archive metadata to retrieve byte sizes of all files
* in the archive. The sizes are needed to accurately decode individual files.
* Parse header metadata to retrieve byte sizes of all files in the archive.
* The sizes are needed to accurately decode individual files.
*
* @param singleFileArchiveMetadata Metadata containing archived file sizes.
* @param headerMetadata Metadata containing archived file sizes.
* @return Array with two elements. First element contains sizes of non-segment
* files. Second element contains the size for each segment.
*/

Check warning on line 81 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L74-L81

[jsdoc/require-throws] Missing JSDoc @throws declaration.
const parseHeaderMetadata = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
singleFileArchiveMetadata: any
headerMetadata: any
): [NonSegmentFileSizes, SegmentFileSizes] => {
if (!singleFileArchiveMetadata.archive_files) {
if (!headerMetadata.archive_files) {

Check failure on line 86 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L86

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

Check failure on line 86 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L86

[@typescript-eslint/no-unsafe-member-access] Unsafe member access .archive_files on an `any` value.
throw new Error("Archive file metadata not found");

Check failure on line 87 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L87

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
}

Check failure on line 88 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L88

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

// Array of files in the archive each containing a name (fileInfo.n) and an

Check failure on line 90 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L90

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
// offset (fileInfo.o).

Check failure on line 91 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L91

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
const fileInfos = singleFileArchiveMetadata.archive_files;
const fileInfos = headerMetadata.archive_files;

Check failure on line 92 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L92

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

Check failure on line 92 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L92

[@typescript-eslint/no-unsafe-assignment] Unsafe assignment of an `any` value.

Check failure on line 92 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L92

[@typescript-eslint/no-unsafe-member-access] Unsafe member access .archive_files on an `any` value.

// Create null instances to fill in afterwards.

Check failure on line 94 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L94

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
const nonSegmentSizes: NonSegmentFileSizes = {

Check failure on line 95 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L95

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
metadataDB: 0,
metadataDb: 0,

Check failure on line 96 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L96

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
logTypeDict: 0,

Check failure on line 97 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L97

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

Check warning on line 97 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L97

[sort-keys] Expected object keys to be in natural ascending order. 'logTypeDict' should be before 'metadataDb'.
logTypeSegIndex: 0,

Check failure on line 98 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L98

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
varDict: 0,

Check failure on line 99 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L99

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
Expand All @@ -114,7 +114,7 @@ const parseHeaderMetadata = (
if (false === isSegment(name)) {

Check failure on line 114 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L114

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

Check failure on line 114 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L114

[no-use-before-define] 'isSegment' was used before it was defined.
switch (name) {

Check failure on line 115 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L115

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.
case "metadata.db":

Check failure on line 116 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L116

[@stylistic/js/indent] Expected indentation of 16 spaces but found 8.
nonSegmentSizes.metadataDB = size;
nonSegmentSizes.metadataDb = size;

Check failure on line 117 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L117

[@stylistic/js/indent] Expected indentation of 20 spaces but found 10.
break;

Check failure on line 118 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L118

[@stylistic/js/indent] Expected indentation of 20 spaces but found 10.
case "logtype.dict":

Check failure on line 119 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L119

[@stylistic/js/indent] Expected indentation of 16 spaces but found 8.
nonSegmentSizes.logTypeDict = size;

Check failure on line 120 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L120

[@stylistic/js/indent] Expected indentation of 20 spaces but found 10.
Expand Down Expand Up @@ -155,19 +155,19 @@ const isSegment = (name: string) => {
*
* @param dataInputStream Byte stream containing single file archive with
* offset at start of database.
* @param metadataDBsize Byte size of database.
* @param metadataDbSize Byte size of database.
* @return Array containing metadata for each segment.
*/
const querySegmentInfos = async (
dataInputStream: DataInputStream,
metadataDBsize: number
metadataDbSize: number
): Promise<SegmentInfo[]> => {
// Required to load the sqljs wasm binary asynchronously.

Check failure on line 165 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L165

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
const SQL: initSqlJs.SqlJsStatic = await initSqlJs({

Check failure on line 166 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L166

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

Check failure on line 166 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L166

[@typescript-eslint/no-unsafe-call] Unsafe call of an `any` typed value.
locateFile: (file) => `static/js/${file}`,

Check failure on line 167 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L167

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
});

Check failure on line 168 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L166-L168

[@typescript-eslint/no-unsafe-assignment] Unsafe assignment of an error typed value.

Check failure on line 168 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L168

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

const dbBytes: Uint8Array = dataInputStream.readFully(metadataDBsize);
const dbBytes: Uint8Array = dataInputStream.readFully(metadataDbSize);

Check failure on line 170 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L170

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

const db = new SQL.Database(dbBytes);

Check failure on line 172 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L172

[@typescript-eslint/no-unsafe-assignment] Unsafe assignment of an error typed value.

Check failure on line 172 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L172

[@typescript-eslint/no-unsafe-call] Unsafe construction of an any type value.

Check failure on line 172 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L172

[@typescript-eslint/no-unsafe-member-access] Unsafe member access .Database on an `any` value.

Check failure on line 172 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L172

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
const queryResult: initSqlJs.QueryExecResult[] = db.exec(`

Check failure on line 173 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L173

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.

Check failure on line 173 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L173

[@typescript-eslint/no-unsafe-call] Unsafe call of an `any` typed value.

Check failure on line 173 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/metadata.ts#L173

[@typescript-eslint/no-unsafe-member-access] Unsafe member access .exec on an `any` value.
Expand Down
27 changes: 14 additions & 13 deletions new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface Segment {
* @param dataInputStream Byte stream containing single file archive with offset
* at start of segments.
* @param segmentSize Array of byte sizes for each segment in archive.

Check warning on line 24 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L24

[jsdoc/check-param-names] Expected @param names to be "dataInputStream, segmentSizes, segmentInfos, logTypeDict, varDict". Got "dataInputStream, segmentSize, segmentInfos, logTypeDict, varDict".
* @param segmentInfos Byte sizes for non-segment archive files.
* @param segmentInfos Segment metadata.
* @param logTypeDict Archive log type dictionary.
* @param varDict Archive variable dictionary.
* @return Array with combined log events from all segments.
Expand All @@ -36,16 +36,16 @@ const deserializeSegments = async (
): Promise<ArchiveLogEvent[]> => {

Check failure on line 36 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L36

[max-params] Async arrow function has too many parameters (5). Maximum allowed is 4.
const logEvents: ArchiveLogEvent[] = [];

Check failure on line 37 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L37

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
for (let index = 0; index < segmentSizes.length; index++) {

Check failure on line 38 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L38

[@stylistic/js/indent] Expected indentation of 4 spaces but found 2.
const size: number | undefined = segmentSizes[index];
const segmentSize: number | undefined = segmentSizes[index];

Check failure on line 39 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L39

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
const segmentInfo: SegmentInfo | undefined = segmentInfos[index];

Check failure on line 40 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L40

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

if (!size || !segmentInfo) {
if (!segmentSize || !segmentInfo) {

Check failure on line 42 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L42

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.
throw new Error("Segment metadata was not found");

Check failure on line 43 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L43

[@stylistic/js/indent] Expected indentation of 12 spaces but found 6.
}

Check failure on line 44 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L44

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

const segment: Segment = await deserializeSegment(

Check failure on line 46 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L46

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

Check failure on line 46 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L46

[no-use-before-define] 'deserializeSegment' was used before it was defined.
dataInputStream,

Check failure on line 47 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L47

[@stylistic/js/indent] Expected indentation of 12 spaces but found 8.
size,
segmentSize,

Check failure on line 48 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L48

[@stylistic/js/indent] Expected indentation of 12 spaces but found 8.
segmentInfo

Check failure on line 49 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L49

[@stylistic/js/indent] Expected indentation of 12 spaces but found 8.
);

Check failure on line 50 in new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

new-log-viewer/src/services/decoders/ClpArchiveDecoder/segment.ts#L50

[@stylistic/js/indent] Expected indentation of 8 spaces but found 4.

Expand Down Expand Up @@ -155,19 +155,20 @@ const toLogEvents = (

/**
* Retrieves dictionary and encoded variables for a specific log message.
* Traverses log type until a variable placeholder is found. For each
* variable placeholder found, a value is popped from the segment variables array.
* Dictionary and encoded variables are distinguished by different byte
* placeholders. If the variable is a dictionary variable, the value is used
* to index into the archive's variable dictionary, and the lookup result is
* added to its array. If the variable is an encoded variable, the value is simply
* added to its array. The function returns two arrays. First for dictionary
* variables, and second for encoded variables.
* The function returns two arrays; The first for dictionary variables,
* and the second for encoded variables. Traverses log type until a variable
* placeholder is found. For each variable placeholder found, a value is
* popped from the segment variables array. Dictionary and encoded variables
* are distinguished by different byte placeholders. If the variable is a
* dictionary variable, the value is used to index into the archive's variable
* dictionary, and the lookup result is added to dictionary array. If the variable is
* an encoded variable, the value is simply added to encoded array.
*
* @param logType Log with placeholders for variables.
* @param segmentVarIterator Iterator for segment variables.
* @param varDict Archive variable dictionary.
* @return Two arrays, the first for dictionary variables and the second for encoded variables.
* @return Two arrays, the first for dictionary variables and the second for
* encoded variables.
*/
const getLogEventVariables = (
logType: Uint8Array,
Expand Down

0 comments on commit 9f8bcf7

Please sign in to comment.