Git Product home page Git Product logo

cabx's Introduction

CabX

cabx's People

Contributors

bschifferer avatar bazile-clyde avatar

Watchers

James Cloos avatar  avatar

Forkers

bschifferer

cabx's Issues

possible code error

backend\test\getLyft_test.js
E030 | 174 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 198 | 6 | }); | Expected an identifier and instead saw ')'.

Global variables

avoid using global variables.

E:\CabX\backend\node_modules\accepts\index.js:23:	Avoid using global variables
E:\CabX\backend\node_modules\array-flatten\array-flatten.js:6:	Avoid using global variables
E:\CabX\backend\node_modules\body-parser\index.js:37:	Avoid using global variables

Use of global variable would cause risk in bug. Since every file and every function could access to global variables and it is hard to figure out whether a function write these variables. When the scale of the application become larger and larger, it would be hard to take every function into account and keep track of every global variables.

possible errors

backend\test\getFindRides_test.js
format: [Error Type] | [Line] | [Column] | [evidence] | [reason]
E030 | 28 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 56 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 108 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 160 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 267 | 6 | }); | Expected an identifier and instead saw ')'.

for-in loop variable

The for-in loop variable

E:\CabX\backend\node_modules\ipaddr.js\ipaddr.min.js:1:	The for-in loop variable 'o' should be explicitly scoped with var to avoid pollution.

Ver1:

for (var x in set) {
    ...
}

Ver2:

for (x in set) {
    ...
}

Ver1 declares a new local variable called x. and Ver2 does not. In this warning, if x declared before, two version equal. But if x is not used before, the ver2 would create a global variable x. which would cause pollution in the naming space. This would lead to bugs.

===/!==

===/!==

E:\CabX\backend\node_modules\iconv-lite\encodings\utf16.js:41:	Use ===/!== to compare with true/false or Numbers

In Javascript, the == equality operator converts between types to find a match, so 1 == true evaluates to true because true is converted to 1. The === type equality operator doesn't do type conversions. Better to use === than == because this could disable auto type conversion and make sure the comparison return the right value.

trailing commas

trailing commas

E:\CabX\backend\node_modules\check-error\index.js:166:	Avoid trailing commas in object or array literals

module.exports = {
  compatibleInstance: compatibleInstance,
  compatibleConstructor: compatibleConstructor,
  compatibleMessage: compatibleMessage,
  getMessage: getMessage,
  getConstructorName: getConstructorName,
}

the comma in the last two line

  getConstructorName: getConstructorName,

is a trailing commas. This feature would make it easy when adding new element and good for version control. It is supported by most of browser in object literals. So I choose to ignore the warning here.

possible code error #2

backend\test\getLatLongFromAddress_test.js

E030 | 50 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 69 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 106 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 135 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 164 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 191 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 216 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 244 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 274 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 334 | 6 | }); | Expected an identifier and instead saw ')'.

possible code error

backend\test\getUber_test.js
E030 | 178 | 6 | }); | Expected an identifier and instead saw ')'.
E030 | 201 | 6 | }); | Expected an identifier and instead saw ')'.

mix return statements with and without a result.

mix return statements with and without a result.

E:\CabX\backend\node_modules\ms\index.js:47:	A function should not mix return statements with and without a result.

The function should always return a value in every condition, otherwise would cause bugs because sometimes cannot get a result when call this function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.