Skip to content

Pull Request for peer review#4

Open
anuonifade wants to merge 43 commits intomasterfrom
development
Open

Pull Request for peer review#4
anuonifade wants to merge 43 commits intomasterfrom
development

Conversation

@anuonifade
Copy link
Owner

What does this PR do?

  • Adds files on development to master branch

Description of Task to be completed?

  • Sets up travis ci on the repository
  • Sets up coveralls
  • Sets up hound
  • Sets up eslint
  • Adds inverted index class files.
  • Adds inverted index controller
  • Adds inverted index html files
  • Adds inverted index css files
  • Adds inverted index javascript and css dependencies

How should this be manually tested?

  • NA

Any background context you want to provide?

  • NA

What are the relevant pivotal tracker stories?

  • NA

Screenshots (if appropriate)

  • NA

Questions:

  • NA

@anuonifade anuonifade temporarily deployed to dplex-staging April 10, 2017 18:59 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 10, 2017 19:16 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 10, 2017 20:04 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 10, 2017 20:08 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 10, 2017 20:10 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 10, 2017 20:14 Inactive
{ indexes: { alice: [0], wonderland: [0] },
searchedFile: 'books1',
documents: [0] }];
expect(this.indexInstance.searchIndex('Alice Wonderland', 'all')).toEqual(expectedOutput);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 8 indent

const expectedOutput = [{ indexes: { alice: [0], wonderland: [0] },
searchedFile: 'books',
documents: [0, 1, 2] },
{ indexes: { alice: [0], wonderland: [0] },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 8 indent

});
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'}];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space is required before '}' object-curly-spacing

expect(expectedOutput[0].indexes).toEqual({ });
});
it('should return an array of objects if filename is all', () => {
const books1 = [{title: 'Alice in Wonderland too',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space is required after '{' object-curly-spacing

});
it('should return an empty object for an words not found', () => {
const term = 'Aeroplane';
const expectedOutput = this.indexInstance.searchIndex(term, 'books');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple spaces found before 'this' no-multi-spaces

this.filesIndexed[filename].numOfDocs = documentNum;
this.filesIndexed[filename].index = this.constructIndex(words);
return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

try {
if (Object.keys(inputData).length < 1) {
this.handleError(filename, 'File contains no document', true);
this.handleError(filename, 'File contains no document', true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

@anuonifade anuonifade temporarily deployed to dplex-staging April 10, 2017 20:18 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 10, 2017 22:04 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 10, 2017 22:06 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 12, 2017 19:29 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 12, 2017 22:07 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 09:55 Inactive
},
{
"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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 62 exceeds the maximum line length of 80 max-len
Strings must use singlequote quotes
Unnecessarily quoted property 'text' found quote-props

@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 10:05 Inactive

describe('InvertedIndex class', () => {
beforeAll(() => {
const validBook = [{ title: 'Welcome to Test Environment',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=[

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 10:10 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 10:11 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 10:14 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 10:28 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 10:31 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 11:05 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 11:09 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 14:41 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 15:45 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 15:48 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 15:54 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 15:54 Inactive
@anuonifade anuonifade temporarily deployed to dplex-staging-pr-4 April 19, 2017 16:14 Inactive
const fileChoice = $scope.uploadToSearch;
$scope.searchQuery = $scope.searchTerm;
if (!$scope.uploadedFiles
.hasOwnProperty(fileChoice) && fileChoice !== 'all') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement no-console

@anuonifade anuonifade temporarily deployed to dplex-staging April 19, 2017 16:14 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants