Conversation
spec/dplex-test-spec.js
Outdated
| { indexes: { alice: [0], wonderland: [0] }, | ||
| searchedFile: 'books1', | ||
| documents: [0] }]; | ||
| expect(this.indexInstance.searchIndex('Alice Wonderland', 'all')).toEqual(expectedOutput); |
There was a problem hiding this comment.
Expected indentation of 6 spaces but found 8 indent
spec/dplex-test-spec.js
Outdated
| const expectedOutput = [{ indexes: { alice: [0], wonderland: [0] }, | ||
| searchedFile: 'books', | ||
| documents: [0, 1, 2] }, | ||
| { indexes: { alice: [0], wonderland: [0] }, |
There was a problem hiding this comment.
Expected indentation of 6 spaces but found 8 indent
spec/dplex-test-spec.js
Outdated
| }); | ||
| it('should return an array of objects if filename is all', () => { | ||
| const books1 = [{title: 'Alice in Wonderland too', | ||
| text: 'Alice adventure in the wonderland was full of drama and action'}]; |
There was a problem hiding this comment.
A space is required before '}' object-curly-spacing
spec/dplex-test-spec.js
Outdated
| expect(expectedOutput[0].indexes).toEqual({ }); | ||
| }); | ||
| it('should return an array of objects if filename is all', () => { | ||
| const books1 = [{title: 'Alice in Wonderland too', |
There was a problem hiding this comment.
A space is required after '{' object-curly-spacing
spec/dplex-test-spec.js
Outdated
| }); | ||
| it('should return an empty object for an words not found', () => { | ||
| const term = 'Aeroplane'; | ||
| const expectedOutput = this.indexInstance.searchIndex(term, 'books'); |
There was a problem hiding this comment.
Multiple spaces found before 'this' no-multi-spaces
src/invertedindex.js
Outdated
| this.filesIndexed[filename].numOfDocs = documentNum; | ||
| this.filesIndexed[filename].index = this.constructIndex(words); | ||
| return true; | ||
|
|
There was a problem hiding this comment.
Trailing spaces not allowed no-trailing-spaces
src/invertedindex.js
Outdated
| try { | ||
| if (Object.keys(inputData).length < 1) { | ||
| this.handleError(filename, 'File contains no document', true); | ||
| this.handleError(filename, 'File contains no document', true); |
There was a problem hiding this comment.
Trailing spaces not allowed no-trailing-spaces
…dified all the files that called it
| }, | ||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", | ||
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." |
There was a problem hiding this comment.
Line 79 exceeds the maximum line length of 80 max-len
Unnecessarily quoted property 'text' found quote-props
Strings must use singlequote quotes
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." | ||
| }, | ||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", |
There was a problem hiding this comment.
Unnecessarily quoted property 'title' found quote-props
Strings must use singlequote quotes
build/bundle.js
Outdated
|
|
||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", | ||
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." |
There was a problem hiding this comment.
Line 75 exceeds the maximum line length of 80 max-len
Strings must use singlequote quotes
Unnecessarily quoted property 'text' found quote-props
build/bundle.js
Outdated
| }, | ||
|
|
||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", |
There was a problem hiding this comment.
Unnecessarily quoted property 'title' found quote-props
Strings must use singlequote quotes
build/bundle.js
Outdated
| }, | ||
| { | ||
| "title": "Alice in Wonderland", | ||
| "text": "Alice falls into a rabbit hole and enters a world full of imagination." |
There was a problem hiding this comment.
Line 70 exceeds the maximum line length of 80 max-len
Unnecessarily quoted property 'text' found quote-props
Strings must use singlequote quotes
build/bundle.js
Outdated
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." | ||
| }, | ||
| { | ||
| "title": "Alice in Wonderland", |
There was a problem hiding this comment.
Unnecessarily quoted property 'title' found quote-props
Strings must use singlequote quotes
build/bundle.js
Outdated
| }, | ||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", | ||
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." |
There was a problem hiding this comment.
Line 66 exceeds the maximum line length of 80 max-len
Unnecessarily quoted property 'text' found quote-props
Strings must use singlequote quotes
build/bundle.js
Outdated
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." | ||
| }, | ||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", |
There was a problem hiding this comment.
Unnecessarily quoted property 'title' found quote-props
Strings must use singlequote quotes
build/bundle.js
Outdated
|
|
||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", | ||
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." |
There was a problem hiding this comment.
Line 62 exceeds the maximum line length of 80 max-len
Strings must use singlequote quotes
Unnecessarily quoted property 'text' found quote-props
spec/InvertedIndex.spec.js
Outdated
|
|
||
| describe('InvertedIndex class', () => { | ||
| beforeAll(() => { | ||
| const validBook = [{ title: 'Welcome to Test Environment', |
There was a problem hiding this comment.
'validBook' is assigned a value but never used no-unused-vars
| describe('InvertedIndex class', () => { | ||
| beforeAll(() => { | ||
| const indexInstance = new InvertedIndex(); | ||
| const validBook = [{ title: 'Welcome to Test Environment', |
There was a problem hiding this comment.
'validBook' is assigned a value but never used no-unused-vars
|
|
||
| { | ||
| "title": "The Lord of the Rings: The Fellowship of the Ring.", | ||
| "text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring." |
There was a problem hiding this comment.
Line 10 exceeds the maximum line length of 80 max-len
Strings must use singlequote quotes
Unnecessarily quoted property 'text' found quote-props
| module.exports=[ | ||
| { | ||
| "title": "Alice in Wonderland", | ||
| "text": "Alice falls into a rabbit hole and enters a world full of imagination." |
There was a problem hiding this comment.
Line 5 exceeds the maximum line length of 80 max-len
Unnecessarily quoted property 'text' found quote-props
Strings must use singlequote quotes
| (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
| module.exports=[ | ||
| { | ||
| "title": "Alice in Wonderland", |
There was a problem hiding this comment.
Strings must use singlequote quotes
Unnecessarily quoted property 'title' found quote-props
| @@ -0,0 +1,303 @@ | |||
| (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |||
| module.exports=[ | |||
There was a problem hiding this comment.
Expected indentation of 2 spaces but found 0 indent
Infix operators must be spaced space-infix-ops
| @@ -0,0 +1,303 @@ | |||
| (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |||
There was a problem hiding this comment.
Move the invocation into the parens that contain the function wrap-iife
Line 1 exceeds the maximum line length of 80 max-len
A space is required after ',' comma-spacing
Missing space before opening brace space-before-blocks
Requires a space after '{' block-spacing
Missing JSDoc comment require-jsdoc
Expected space(s) after "if" keyword-spacing
All 'var' declarations must be at the top of the function scope vars-on-top
Unexpected var, use let or const instead no-var
Infix operators must be spaced space-infix-ops
Expected '===' and instead saw '==' eqeqeq
Strings must use singlequote quotes
Missing whitespace after semicolon semi-spacing
Expected space(s) before "return" keyword-spacing
'i' was used before it was defined no-use-before-define
Unexpected string concatenation prefer-template
Missing semicolon semi
Requires a space before '}' block-spacing
Expected space(s) before "var" keyword-spacing
A space is required after '{' object-curly-spacing
Missing space before value for key 'exports' key-spacing
A space is required before '}' object-curly-spacing
Unexpected function expression prefer-arrow-callback
Missing space before function parentheses space-before-function-paren
'e' is already declared in the upper scope no-shadow
'n' is already declared in the upper scope no-shadow
Unnecessary use of conditional expression for default assignment no-unneeded-ternary
Expected space(s) after "for" keyword-spacing
Unary operator '++' used no-plusplus
Missing space before value for key '1' key-spacing
'exports' is defined but never used no-unused-vars
| const fileChoice = $scope.uploadToSearch; | ||
| $scope.searchQuery = $scope.searchTerm; | ||
| if (!$scope.uploadedFiles | ||
| .hasOwnProperty(fileChoice) && fileChoice !== 'all') { |
There was a problem hiding this comment.
Do not access Object.prototype method 'hasOwnProperty' from target object no-prototype-builtins
| // Start server | ||
| const port = process.env.PORT || 3000; | ||
| connect().use(serveStatic('./src')).listen(port); | ||
| app.listen(port, () => console.log(`Listening on port ${port}`)); |
There was a problem hiding this comment.
Unexpected console statement no-console
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
Any background context you want to provide?
What are the relevant pivotal tracker stories?
Screenshots (if appropriate)
Questions: