diff --git a/.codeclimate.yml b/.codeclimate.yml index 53f90d17..fbd96af2 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -5,11 +5,13 @@ engines: bundler-audit: enabled: true duplication: - enabled: false + enabled: true config: languages: - - ruby - - javascript + ruby: + mass_threshold: 36 # default: 18 + javascript: + mass_threshold: 80 # default: 40 eslint: enabled: true channel: "eslint-3" diff --git a/frontend/src/Metamaps/Import.js b/frontend/src/Metamaps/Import.js index aa75b382..1307aa45 100644 --- a/frontend/src/Metamaps/Import.js +++ b/frontend/src/Metamaps/Import.js @@ -54,13 +54,13 @@ const Import = { const topicsPromise = $.Deferred() parse(topicsText, csv_parser_options, (err, data) => { - if (err) topicsPromise.reject(err) + if (err) return topicsPromise.reject(err) topicsPromise.resolve(data.map(row => self.lowercaseKeys(row))) }) const synapsesPromise = $.Deferred() parse(synapsesText, csv_parser_options, (err, data) => { - if (err) synapsesPromise.reject(err) + if (err) return synapsesPromise.reject(err) synapsesPromise.resolve(data.map(row => self.lowercaseKeys(row))) }) diff --git a/frontend/src/Metamaps/PasteInput.js b/frontend/src/Metamaps/PasteInput.js index 13258857..e7029d66 100644 --- a/frontend/src/Metamaps/PasteInput.js +++ b/frontend/src/Metamaps/PasteInput.js @@ -63,7 +63,8 @@ const PasteInput = { Import.handleJSON(text) } else if (text.match(/\t/)) { Import.handleTSV(text) - } else if (text.match(/","/)) { + } else { + // just try to see if CSV works Import.handleCSV(text) } }, diff --git a/webpack.config.js b/webpack.config.js index fcdcbc04..f94f904a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,3 @@ -const path = require('path') const webpack = require('webpack') const NODE_ENV = process.env.NODE_ENV || 'development' @@ -15,9 +14,12 @@ if (NODE_ENV === 'production') { })) } +const devtool = NODE_ENV === 'production' ? undefined : 'cheap-module-eval-source-map' + const config = module.exports = { context: __dirname, plugins, + devtool, module: { loaders: [ {