Skip to content

Commit

Permalink
spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
oatkiller committed Jul 27, 2020
1 parent 2175ecd commit 1e7abdf
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function dataAccessLayerFactory(
},

/**
* Used to get the default index pattern from the SIEM app.
* Used to get the default index pattern from the SIEM application.
*/
indexPatterns(): string[] {
return context.services.uiSettings.get(defaultIndexKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function isTerminatedProcess(passedEvent: ResolverEvent) {
}

/**
* ms since unix epoc, based on timestamp.
* ms since Unix epoc, based on timestamp.
* may return NaN if the timestamp wasn't present or was invalid.
*/
export function datetime(passedEvent: ResolverEvent): number | null {
Expand Down Expand Up @@ -85,7 +85,7 @@ export function eventType(passedEvent: ResolverEvent): ResolverProcessType {
}

/**
* Returns the process event's pid
* Returns the process event's PID
*/
export function uniquePidForProcess(passedEvent: ResolverEvent): string {
if (event.isLegacyEvent(passedEvent)) {
Expand All @@ -96,7 +96,7 @@ export function uniquePidForProcess(passedEvent: ResolverEvent): string {
}

/**
* Returns the pid for the process on the host
* Returns the PID for the process on the host
*/
export function processPid(passedEvent: ResolverEvent): number | undefined {
if (event.isLegacyEvent(passedEvent)) {
Expand All @@ -107,7 +107,7 @@ export function processPid(passedEvent: ResolverEvent): number | undefined {
}

/**
* Returns the process event's parent pid
* Returns the process event's parent PID
*/
export function uniqueParentPidForProcess(passedEvent: ResolverEvent): string | undefined {
if (event.isLegacyEvent(passedEvent)) {
Expand All @@ -118,7 +118,7 @@ export function uniqueParentPidForProcess(passedEvent: ResolverEvent): string |
}

/**
* Returns the process event's parent pid
* Returns the process event's parent PID
*/
export function processParentPid(passedEvent: ResolverEvent): number | undefined {
if (event.isLegacyEvent(passedEvent)) {
Expand Down Expand Up @@ -149,7 +149,7 @@ export function userInfoForProcess(
}

/**
* Returns the MD5 hash for the `passedEvent` param, or undefined if it can't be located
* Returns the MD5 hash for the `passedEvent` parameter, or undefined if it can't be located
* @param {ResolverEvent} passedEvent The `ResolverEvent` to get the MD5 value for
* @returns {string | undefined} The MD5 string for the event
*/
Expand All @@ -164,7 +164,7 @@ export function md5HashForProcess(passedEvent: ResolverEvent): string | undefine
/**
* Returns the command line path and arguments used to run the `passedEvent` if any
*
* @param {ResolverEvent} passedEvent The `ResolverEvent` to get the arguemnts value for
* @param {ResolverEvent} passedEvent The `ResolverEvent` to get the arguments value for
* @returns {string | undefined} The arguments (including the path) used to run the process
*/
export function argsForProcess(passedEvent: ResolverEvent): string | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ type MiddlewareFactory<S = ResolverState> = (
) => (next: Dispatch<ResolverAction>) => (action: ResolverAction) => unknown;

/**
* The redux middleware that the app uses to trigger side effects.
* The `redux` middleware that the application uses to trigger side effects.
* All data fetching should be done here.
* For actions that the app triggers directly, use `app` as a prefix for the type.
* For actions that the application triggers directly, use `app` as a prefix for the type.
* For actions that are triggered as a result of server interaction, use `server` as a prefix for the type.
*/
export const resolverMiddlewareFactory: MiddlewareFactory = (dataAccessLayer: DataAccessLayer) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ expect.extend({
// Set to true if the test passes.
let pass: boolean = false;

// Aysync iterate over the iterable
// Async iterate over the iterable
for await (const received of receivedIterable) {
// keep track of the last value. Used in both pass and fail messages
lastReceived = received;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ResolverAction } from '../../store/actions';
*/
export class Simulator {
/**
* A string that uniquely identifies this Resolver instance amoung others mounted in the DOM.
* A string that uniquely identifies this Resolver instance among others mounted in the DOM.
*/
private readonly resolverComponentInstanceID: string;
/**
Expand Down Expand Up @@ -54,7 +54,7 @@ export class Simulator {
*/
dataAccessLayer: DataAccessLayer;
/**
* A string that uniquely identifies this Resolver instance amoung others mounted in the DOM.
* A string that uniquely identifies this Resolver instance among others mounted in the DOM.
*/
resolverComponentInstanceID: string;
/**
Expand All @@ -76,13 +76,13 @@ export class Simulator {
this.spyMiddleware.middleware
);

// Create a redux store w/ the top level Resolver reducer and the enhancer that includes the Resolver middleware and the spyMiddleware
// Create a redux store w/ the top level Resolver reducer and the enhancer that includes the Resolver middleware and the `spyMiddleware`
this.store = createStore(resolverReducer, middlewareEnhancer);

// Create a fake 'history' instance that Resolver will use to read and write query string values
this.history = createMemoryHistory();

// Used for KibanaContextProvider
// Used for `KibanaContextProvider`
const coreStart: CoreStart = coreMock.createStart();

// Render Resolver via the `MockResolver` component, using `enzyme`.
Expand Down Expand Up @@ -121,7 +121,7 @@ export class Simulator {
let resolveState: (() => void) | null = null;

const promise: Promise<undefined> = new Promise((resolve) => {
// immedatiely expose the resolve function in the outer scope. it will be resolved when the next state transition occurs.
// Immediately expose the resolve function in the outer scope. It will be resolved when the next state transition occurs.
resolveState = resolve;
});

Expand Down Expand Up @@ -150,16 +150,16 @@ export class Simulator {
*
* Code will test assertions after each state transition. If the assertion hasn't passed and no further state transitions occur,
* then the jest timeout will happen. The timeout doesn't give a useful message about the assertion.
* By shortcircuiting this function, code that uses it can short circuit the test timeout and print a useful error message.
* By short-circuiting this function, code that uses it can short circuit the test timeout and print a useful error message.
*
* NB: the logic to shortcircuit the loop is here because knowledge of state is a concern of the simulator, not tests.
* NB: the logic to short-circuit the loop is here because knowledge of state is a concern of the simulator, not tests.
*/
let timeoutCount = 0;
while (true) {
/**
* `await` a race between the next state transition and a timeout that happens after `0`ms.
* If the timeout wins, no `dispatch` call caused a state transition in the last loop.
* If this keeps happening, assume that Resolver isn't going to do anythig else.
* If this keeps happening, assume that Resolver isn't going to do anything else.
*
* If Resolver adds intentional delay logic (e.g. waiting before making a request), this code might have to change.
* In that case, Resolver should use the side effect context to schedule future work. This code could then subscribe to some event published by the side effect context. That way, this code will be aware of Resolver's intention to do work.
Expand All @@ -186,7 +186,7 @@ export class Simulator {
return;
}
} else {
// If a state transition occurs, reset the timout count and yield the value
// If a state transition occurs, reset the timeout count and yield the value
timeoutCount = 0;
yield mapper();
}
Expand Down Expand Up @@ -263,7 +263,7 @@ const baseResolverSelector = '[data-test-subj="resolver:node"]';

interface ProcessNodeElementSelectorOptions {
/**
* Entity ID of the node. If passed, will be used to create an data-attribtue CSS selector that should only get the related node element.
* Entity ID of the node. If passed, will be used to create an data-attribute CSS selector that should only get the related node element.
*/
entityID?: string;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type MockResolverProps = {
*/
rasterHeight?: number;
/**
* Used for the KibanaContextProvider
* Used for the `KibanaContextProvider`
*/
coreStart: CoreStart;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SpyMiddleware, SpyMiddlewareStateActionPair } from '../types';

/**
* Return a `SpyMiddleware` to be used in testing. Use `debugActions` to console.log actions and the state they produced.
* For reducer/middleware tests, you can use `actions` to get access to each dispatched action along w/ the state it produced.
* For reducer/middleware tests, you can use `actions` to get access to each dispatched action along with the state it produced.
*/
export const spyMiddlewareFactory: () => SpyMiddleware = () => {
const resolvers: Set<(stateActionPair: SpyMiddlewareStateActionPair) => void> = new Set();
Expand Down
42 changes: 21 additions & 21 deletions x-pack/plugins/security_solution/public/resolver/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ export interface ResolverState {
}

/**
* Piece of redux state that models an animation for the camera.
* Piece of `redux` state that models an animation for the camera.
*/
export interface ResolverUIState {
/**
* The nodeID for the process that is selected (in the aria-activedescendent sense of being selected.)
* The `nodeID` for the process that is selected (in the `aria-activedescendent` sense of being selected.)
*/
readonly ariaActiveDescendant: string | null;
/**
* nodeID of the selected node
* `nodeID` of the selected node
*/
readonly selectedNode: string | null;
}

/**
* Piece of redux state that models an animation for the camera.
* Piece of `redux` state that models an animation for the camera.
*/
export interface CameraAnimationState {
/**
Expand All @@ -76,7 +76,7 @@ export interface CameraAnimationState {
}

/**
* The redux state for the `useCamera` hook.
* The `redux` state for the `useCamera` hook.
*/
export type CameraState = {
/**
Expand All @@ -96,7 +96,7 @@ export type CameraState = {
readonly translationNotCountingCurrentPanning: Vector2;

/**
* The world coordinates that the pointing device was last over. This is used during mousewheel zoom.
* The world coordinates that the pointing device was last over. This is used during mouse-wheel zoom.
*/
readonly latestFocusedWorldCoordinates: Vector2 | null;
} & (
Expand Down Expand Up @@ -143,15 +143,15 @@ export type CameraState = {
export type IndexedEntity = IndexedEdgeLineSegment | IndexedProcessNode;

/**
* The entity stored in rbush for resolver edge lines.
* The entity stored in `rbush` for resolver edge lines.
*/
export interface IndexedEdgeLineSegment extends BBox {
type: 'edgeLine';
entity: EdgeLineSegment;
}

/**
* The entity store in rbush for resolver process nodes.
* The entity store in `rbush` for resolver process nodes.
*/
export interface IndexedProcessNode extends BBox {
type: 'processNode';
Expand All @@ -168,7 +168,7 @@ export interface VisibleEntites {
}

/**
* State for `data` reducer which handles receiving Resolver data from the backend.
* State for `data` reducer which handles receiving Resolver data from the back-end.
*/
export interface DataState {
readonly relatedEvents: Map<string, ResolverRelatedEvents>;
Expand Down Expand Up @@ -221,11 +221,11 @@ export type Vector2 = readonly [number, number];
*/
export interface AABB {
/**
* Vector who's `x` component is the _left_ side of the AABB and who's `y` component is the _bottom_ side of the AABB.
* Vector who's `x` component is the _left_ side of the `AABB` and who's `y` component is the _bottom_ side of the `AABB`.
**/
readonly minimum: Vector2;
/**
* Vector who's `x` component is the _right_ side of the AABB and who's `y` component is the _bottom_ side of the AABB.
* Vector who's `x` component is the _right_ side of the `AABB` and who's `y` component is the _bottom_ side of the `AABB`.
**/
readonly maximum: Vector2;
}
Expand Down Expand Up @@ -274,7 +274,7 @@ export interface ProcessEvent {
}

/**
* A represention of a process tree with indices for O(1) access to children and values by id.
* A representation of a process tree with indices for O(1) access to children and values by id.
*/
export interface IndexedProcessTree {
/**
Expand All @@ -288,7 +288,7 @@ export interface IndexedProcessTree {
}

/**
* A map of ProcessEvents (representing process nodes) to the 'width' of their subtrees as calculated by `widthsOfProcessSubtrees`
* A map of `ProcessEvents` (representing process nodes) to the 'width' of their subtrees as calculated by `widthsOfProcessSubtrees`
*/
export type ProcessWidths = Map<ResolverEvent, number>;
/**
Expand Down Expand Up @@ -326,24 +326,24 @@ export interface DurationDetails {
*/
export interface EdgeLineMetadata {
elapsedTime?: DurationDetails;
// A string of the two joined process nodes concatted together.
// A string of the two joined process nodes concatenated together.
uniqueId: string;
}
/**
* A tuple of 2 vector2 points forming a polyline. Used to connect process nodes in the graph.
* A tuple of 2 vector2 points forming a poly-line. Used to connect process nodes in the graph.
*/
export type EdgeLinePoints = Vector2[];

/**
* Edge line components including the points joining the edgeline and any optional associated metadata
* Edge line components including the points joining the edge-line and any optional associated metadata
*/
export interface EdgeLineSegment {
points: EdgeLinePoints;
metadata: EdgeLineMetadata;
}

/**
* Used to provide precalculated info from `widthsOfProcessSubtrees`. These 'width' values are used in the layout of the graph.
* Used to provide pre-calculated info from `widthsOfProcessSubtrees`. These 'width' values are used in the layout of the graph.
*/
export type ProcessWithWidthMetadata = {
process: ResolverEvent;
Expand Down Expand Up @@ -431,11 +431,11 @@ export type ResolverStore = Store<ResolverState, ResolverAction>;
*/
export interface IsometricTaxiLayout {
/**
* A map of events to position. each event represents its own node.
* A map of events to position. Each event represents its own node.
*/
processNodePositions: Map<ResolverEvent, Vector2>;
/**
* A map of edgline segments, which graphically connect nodes.
* A map of edge-line segments, which graphically connect nodes.
*/
edgeLineSegments: EdgeLineSegment[];

Expand Down Expand Up @@ -494,8 +494,8 @@ export interface ResolverProps {
*/
databaseDocumentID?: string;
/**
* A string literal describing where in the app resolver is located,
* used to prevent collisions in things like query params
* A string literal describing where in the application resolver is located.
* Used to prevent collisions in things like query parameters.
*/
resolverComponentInstanceID: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const StyledDescriptionList = styled(EuiDescriptionList)`

/**
* A description list view of all the Metadata that goes with a particular process event, like:
* Created, Pid, User/Domain, etc.
* Created, PID, User/Domain, etc.
*/
export const ProcessDetails = memo(function ProcessDetails({
processEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export function useResolverQueryParams() {
const uniqueCrumbEventKey: string = `resolver-${resolverComponentInstanceID}-event`;
const pushToQueryParams = useCallback(
(newCrumbs: CrumbInfo) => {
// Construct a new set of params from the current set (minus empty params)
// by assigning the new set of params provided in `newCrumbs`
// Construct a new set of parameters from the current set (minus empty parameters)
// by assigning the new set of parameters provided in `newCrumbs`
const crumbsToPass = {
...querystring.parse(urlSearch.slice(1)),
[uniqueCrumbIdKey]: newCrumbs.crumbId,
Expand Down

0 comments on commit 1e7abdf

Please sign in to comment.