Skip to content

Commit

Permalink
[qa] Remove bad code practices #129
Browse files Browse the repository at this point in the history
closes #129
  • Loading branch information
totallynotvaishnav committed Jun 17, 2022
1 parent 4c92812 commit 2929cce
Show file tree
Hide file tree
Showing 44 changed files with 45,586 additions and 2,688 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/node_modules
/dist
webpack.*.js
.eslintrc.json
.eslintrc.js
/lib
/examples
/coverage
9 changes: 3 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
module.exports = {
extends: ["airbnb", "prettier"],
extends: ['airbnb', 'prettier'],
rules: {
"no-underscore-dangle": "off",
"no-plusplus": "off",
"no-param-reassign": "off",
"class-methods-use-this": "off",
"no-restricted-syntax": "off",
'no-param-reassign': 'off',
'class-methods-use-this': 'off',
},
env: {
jest: true,
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ yarn-error.log*
.*.swo

#other
examples/
lib/
609 changes: 608 additions & 1 deletion examples/data/airplaneRouteMap.json

Large diffs are not rendered by default.

70 changes: 38 additions & 32 deletions examples/data/generateNode.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,50 @@
let nodeLength = 10000, categoryLength = 10;
let nodes = [], links = [], JSONData = {
"type":"NetworkGraph",
"label":"Ninux Roma",
"protocol":"OLSR",
"version":"0.6.6.2",
"metric":"ETX",
"date":"2019-04-03T05:06:54.000Z",
};
let nodeLength = 10000,
categoryLength = 10;
let nodes = [],
links = [],
JSONData = {
type: 'NetworkGraph',
label: 'Ninux Roma',
protocol: 'OLSR',
version: '0.6.6.2',
metric: 'ETX',
date: '2019-04-03T05:06:54.000Z',
};

for(let i = 0;i < nodeLength;i++){
for (let i = 0; i < nodeLength; i++) {
let node1 = {
id: i,
category: "category" + parseInt(Math.random() * categoryLength),
name: Math.random().toString(36).slice(2,8),
location: {
lng: Math.random() * 180 - 90,
lat: Math.random() * 360,
}
}, node2 = {
id: nodeLength + i,
category: "category" + parseInt(Math.random() * categoryLength),
name: Math.random().toString(36).slice(2, 8),
location: {
lng: Math.random() * 180 - 90,
lat: Math.random() * 360,
}
};
id: i,
category: 'category' + parseInt(Math.random() * categoryLength),
name: Math.random().toString(36).slice(2, 8),
location: {
lng: Math.random() * 180 - 90,
lat: Math.random() * 360,
},
},
node2 = {
id: nodeLength + i,
category: 'category' + parseInt(Math.random() * categoryLength),
name: Math.random().toString(36).slice(2, 8),
location: {
lng: Math.random() * 180 - 90,
lat: Math.random() * 360,
},
};

let link = {
source: node1.id,
target: node2.id,
cost: Math.random() * 10,
}
};

nodes.push(node1, node2);
links.push(link);
}

console.log(JSON.stringify({
...JSONData,
nodes,
links
}));
console.log(
JSON.stringify({
...JSONData,
nodes,
links,
}),
);

0 comments on commit 2929cce

Please sign in to comment.