File tree Expand file tree Collapse file tree 6 files changed +23
-8
lines changed Expand file tree Collapse file tree 6 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 5151 ]
5252 }
5353 ],
54- "space-infix-ops" : [" error" , {"int32Hint" : false }]
54+ "space-infix-ops" : [
55+ " error" ,
56+ {
57+ "int32Hint" : false
58+ }
59+ ],
60+ "space-before-blocks" : " error" ,
61+ "keyword-spacing" : [
62+ " error" ,
63+ {
64+ "before" : true
65+ }
66+ ]
5567 }
5668}
Original file line number Diff line number Diff line change 1515 */
1616
1717
18- // Load Sequelize and create an in-memory database
1918const Sequelize = require ( 'sequelize' ) ;
2019const fs = require ( 'fs' ) ;
2120const JSONStream = require ( 'JSONStream' ) ;
@@ -26,6 +25,10 @@ const {parentPath} = require('./models/databaseUtils');
2625 * Manages the database created from a ScanCode JSON input.
2726 * The database contains tables for both flattened and unflattened data
2827 *
28+ * The config will load an existing database or will create a new, empty
29+ * database if none exists. For a new database, the data is loaded from a JSON
30+ * file by calling addFromJson(jsonFileName).
31+ *
2932 * @param config
3033 * @param config.dbName
3134 * @param config.dbUser
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ class AboutCodeDashboard extends View {
259259 static formatData ( names ) {
260260 // Sum the total number of times the name appears
261261 let count = { } ;
262- $ . each ( names , function ( i , name ) {
262+ $ . each ( names , function ( i , name ) {
263263 count [ name ] = count [ name ] + 1 || 1 ;
264264 } ) ;
265265
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ class BarChart {
164164
165165 let maxStr = '' ;
166166 $ . each ( names , function ( i , name ) {
167- if ( name . length > maxStr . length ) {
167+ if ( name . length > maxStr . length ) {
168168 maxStr = name ;
169169 }
170170 } ) ;
@@ -182,7 +182,7 @@ class BarChart {
182182
183183 // Sum the total number of times the name appears
184184 let count = { } ;
185- $ . each ( names , function ( i , name ) {
185+ $ . each ( names , function ( i , name ) {
186186 count [ name ] = count [ name ] + 1 || 1 ;
187187 } ) ;
188188
@@ -196,7 +196,7 @@ class BarChart {
196196 } ) ;
197197
198198 // Sorts the data highest value to lowest value
199- chartData . sort ( function ( a , b ) {
199+ chartData . sort ( function ( a , b ) {
200200 if ( a . val === b . val ) {
201201 return a . name . localeCompare ( b . name ) ;
202202 } else {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class Utils {
2323 for ( let i = 0 ; i < values . length ; i ++ ) {
2424 attributeValue = values [ i ] [ attribute ] ;
2525
26- if ( ! Array . isArray ( attributeValue ) || attributeValue . length === 0 ) {
26+ if ( ! Array . isArray ( attributeValue ) || attributeValue . length === 0 ) {
2727 attributeValue = [ attributeValue ] ;
2828 }
2929
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ const esLintResults = engine.executeOnFiles(files).results;
3636// for each failure
3737describe ( 'ESLint' , ( ) => esLintResults . forEach ( ( { filePath, messages } ) => {
3838 it ( `validates ${ filePath } ` , ( ) => {
39- if ( messages ) {
39+ if ( messages . length > 0 ) {
4040 assert . fail ( false , true , messages . map ( formatError ) . join ( '\n' ) ) ;
4141 }
4242 } ) ;
You can’t perform that action at this time.
0 commit comments