Skip to content

Commit

Permalink
first upload
Browse files Browse the repository at this point in the history
  • Loading branch information
itamar bitton committed Nov 23, 2018
0 parents commit 476db7c
Show file tree
Hide file tree
Showing 14 changed files with 11,222 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stryker.conf.js
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"browser": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 2015,
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"max-lines-per-function": [
"error",
20
],
"complexity": [
"error",
5
]
}
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea
node_modules
dist
dist-tests
.nyc_output
coverage
lint
reports
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: node_js

node_js:
- 10
- node

cache: npm

script:
- npm install
- npm run test

notifications:
email:
recipients:
- bittonit@bgu.ac.il
on_failure: always
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Sample project

* Use this project as a template.
* Clone the project:
* Using user/password: `git clone https://github.com/aviram26/sqe-workshop-2018-sample-project.git`
* Using SSH key: `git clone git@github.com:aviram26/sqe-workshop-2018-sample-project.git`
* Install all libraries run: `npm install`
* For code parsing, this project uses the [Esprima](http://esprima.org/) library.
* See example usage in `src/js/code-analyzer.js`
* Run the project:
* From the command-line run: `npm start`
* After the bundler is done, execute the `index.html` from your IDE (preferably `WebStorm`)
* Try the parser...
* For testing, this project uses the [Mocha](https://mochajs.org/) library.
* From the command-line run: `npm run test`
* See example test in `test/code-analyzer.test.js`
* For coverage, this project uses the [nyc](https://github.com/istanbuljs/nyc) library.
* From the command-line run: `npm run coverage`
* Run `coverage/lcov-report/index.html` to see the html report
* For linting, this project uses the [ESLint](https://eslint.org/) library.
* From the command-line run: `npm run lint`
* See the report file `lint/eslint-report.json`

#### I/O Example

The input:

```javascript
function binarySearch(X, V, n){
let low, high, mid;
low = 0;
high = n - 1;
while (low <= high) {
mid = (low + high)/2;
if (X < V[mid])
high = mid - 1;
else if (X > V[mid])
low = mid + 1;
else
return mid;
}
return -1;
}
```

Should produce:

Line | Type | Name | Value
--- | --- | --- | ---
1 | FunctionDeclaration | binarySearch |
1 | Param | X |
... | ... | ... | ...
2 | VariableDeclarator | low | 0
... | ... | ... | ...
64 changes: 64 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
table {
width: 100%;
height: 100%;
}

.textAreaWrapper {
width: 100%;
height: 80vh;
}

textarea {
width: 80%;
height: 95%;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<div>
<label>Enter code here</label>
</div>
</td>
<td>
<div>
<label>Parsed code here</label>
</div>
</td>
</tr>
<tr>
<td>
<div class="textAreaWrapper">
<textarea id="codePlaceholder" title="Enter code here"></textarea>
</div>
</td>
<td>
<div class="textAreaWrapper">
<textarea id="parsedCode" title="Parse code"></textarea>
</div>
</td>
</tr>
<tr>
<td>
<div>
<button id="codeSubmissionButton">Parse code</button>
</div>
</td>
<td>
</td>
</tr>
</table>
<div id="resultTable">

</div>
<script src="dist/bundle.js"></script>
</body>
</html>
Loading

0 comments on commit 476db7c

Please sign in to comment.