File tree 4 files changed +202
-1
lines changed
4 files changed +202
-1
lines changed Original file line number Diff line number Diff line change
1
+ version = 1
2
+
3
+ [[analyzers ]]
4
+ name = " javascript"
5
+ enabled = true
6
+
7
+ [analyzers .meta ]
8
+ environment = [' nodejs' ]
Original file line number Diff line number Diff line change
1
+ # Logs
2
+ logs
3
+ * .log
4
+ npm-debug.log *
5
+ yarn-debug.log *
6
+ yarn-error.log *
7
+ lerna-debug.log *
8
+
9
+ # Diagnostic reports (https://nodejs.org/api/report.html)
10
+ report. [0-9 ]* . [0-9 ]* . [0-9 ]* . [0-9 ]* .json
11
+
12
+ # Runtime data
13
+ pids
14
+ * .pid
15
+ * .seed
16
+ * .pid.lock
17
+
18
+ # Directory for instrumented libs generated by jscoverage/JSCover
19
+ lib-cov
20
+
21
+ # Coverage directory used by tools like istanbul
22
+ coverage
23
+ * .lcov
24
+
25
+ # nyc test coverage
26
+ .nyc_output
27
+
28
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29
+ .grunt
30
+
31
+ # Bower dependency directory (https://bower.io/)
32
+ bower_components
33
+
34
+ # node-waf configuration
35
+ .lock-wscript
36
+
37
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
38
+ build /Release
39
+
40
+ # Dependency directories
41
+ node_modules /
42
+ jspm_packages /
43
+
44
+ # Snowpack dependency directory (https://snowpack.dev/)
45
+ web_modules /
46
+
47
+ # TypeScript cache
48
+ * .tsbuildinfo
49
+
50
+ # Optional npm cache directory
51
+ .npm
52
+
53
+ # Optional eslint cache
54
+ .eslintcache
55
+
56
+ # Microbundle cache
57
+ .rpt2_cache /
58
+ .rts2_cache_cjs /
59
+ .rts2_cache_es /
60
+ .rts2_cache_umd /
61
+
62
+ # Optional REPL history
63
+ .node_repl_history
64
+
65
+ # Output of 'npm pack'
66
+ * .tgz
67
+
68
+ # Yarn Integrity file
69
+ .yarn-integrity
70
+
71
+ # dotenv environment variables file
72
+ .env
73
+ .env.test
74
+
75
+ # parcel-bundler cache (https://parceljs.org/)
76
+ .cache
77
+ .parcel-cache
78
+
79
+ # Next.js build output
80
+ .next
81
+ out
82
+
83
+ # Nuxt.js build / generate output
84
+ .nuxt
85
+ dist
86
+
87
+ # Gatsby files
88
+ .cache /
89
+ # Comment in the public line in if your project uses Gatsby and not Next.js
90
+ # https://nextjs.org/blog/next-9-1#public-directory-support
91
+ # public
92
+
93
+ # vuepress build output
94
+ .vuepress /dist
95
+
96
+ # Serverless directories
97
+ .serverless /
98
+
99
+ # FuseBox cache
100
+ .fusebox /
101
+
102
+ # DynamoDB Local files
103
+ .dynamodb /
104
+
105
+ # TernJS port file
106
+ .tern-port
107
+
108
+ # Stores VSCode versions used for testing VSCode extensions
109
+ .vscode-test
110
+
111
+ # yarn v2
112
+ .yarn /cache
113
+ .yarn /unplugged
114
+ .yarn /build-state.yml
115
+ .yarn /install-state.gz
116
+ .pnp. *
Original file line number Diff line number Diff line change 1
- # demo-js
1
+ <p align =" center " >
2
+ <img src =" https://deepsource.io/images/logo-wordmark-dark.svg " />
3
+ </p >
4
+
5
+ <p align =" center " >
6
+ <a href =" https://deepsource.io/docs/ " >Documentation</a > |
7
+ <a href =" https://deepsource.io/signup/ " >Get Started</a > |
8
+ <a href =" https://discuss.deepsource.io/ " >Discuss</a >
9
+ </p >
10
+
11
+ <p align =" center " >
12
+ DeepSource helps you ship good quality code.
13
+ </p >
14
+
15
+ </p >
16
+
17
+ ---
18
+
19
+ # Demo repository - JavaScript
20
+
21
+ This repository demonstrates sample issues in JavaScript code raised by DeepSource.
22
+
23
+ [ ![ DeepSource] ( https://deepsource.io/gh/deepsourcelabs/demo-js.svg/?label=active+issues&show_trend=true )] ( https://deepsource.io/gh/deepsourcelabs/demo-js/?ref=repository-badge )
24
+
25
+ ### Report
26
+
27
+ [ https://deepsource.io/gh/deepsourcelabs/demo-js/issues/ ] ( https://deepsource.io/gh/deepsourcelabs/demo-js/issues/ )
28
+
29
+ ### Documentation
30
+
31
+ [ https://deepsource.io/docs/analyzer/javascript.html ] ( https://deepsource.io/docs/analyzer/javascript.html )
Original file line number Diff line number Diff line change
1
+ function isEven ( x ) {
2
+ if ( x % 2 = 0 ) console . log ( `${ x } is even` )
3
+ else console . log ( `${ x } is odd` )
4
+ }
5
+
6
+ function isNumber ( num ) {
7
+ let x = undefined
8
+ x = num % 2
9
+ if ( false ) {
10
+ console . log ( "Number is false" )
11
+ } else if ( ! ! x ) {
12
+ console . log ( `Number: ${ x } ` )
13
+ } else if ( 2 == x ) { }
14
+ }
15
+
16
+ function isTruthy ( x ) {
17
+ debugger ;
18
+ return Boolean ( x ) ;
19
+ } ;
20
+
21
+ function area ( r ) {
22
+ let math = Math ( )
23
+ return math . PI * r * r ;
24
+ }
25
+
26
+ function isFooAvailable ( obj ) {
27
+ console . log ( `Value of obj[foo]: ${ obj [ 'foo' ] } ` )
28
+ return obj . hasOwnProperty ( 'foo' )
29
+ }
30
+
31
+ function findFooBar ( ) {
32
+ var re = / = f o o b a r / ;
33
+ re . test ( 'foobar' )
34
+ }
35
+
36
+ function consoleFoo ( num ) {
37
+ while ( ( num != 3 ) ) {
38
+ break ;
39
+ console . log ( num -- )
40
+ }
41
+
42
+ }
43
+
44
+ let result = isFooAvailable ( {
45
+ 'bar' : 'bar' ,
46
+ 'z' : 'z'
47
+ } )
You can’t perform that action at this time.
0 commit comments