How to refactor this kind of code to fix codeclimate duplication report?
<p>I use react &amp; flux to develop my frontend web app:</p>

<p>So I define the constants like this:</p>

<p><strong>/js/constants/AppConstants.js</strong></p>

<pre><code>const KeyMirror = require('keymirror');

module.exports = {
  PayloadSources: KeyMirror({
    SERVER_ACTION: null,
    VIEW_ACTION: null
  })
};
</code></pre>

<p><strong>/js/constants/ProductConstants.js</strong></p>

<pre><code>const KeyMirror = require('keymirror');

module.exports = {
  ActionTypes: KeyMirror({
    GET_PRODUCT: null,
    UPDATE_PRODUCT: null,
  })
};
</code></pre>

<p>This totally works and is correct, then I push these codes to Github (with Codeclimate integration).</p>

<p>Codeclimate says:</p>

<pre><code>Similar code found in 1 other location (mass = 54)
const KeyMirror = require('keymirror');
</code></pre>

<p>Obviously, we see that this line <code>const KeyMirror = require('keymirror')</code> was defined in 2 different files, and Codeclimate thinks this should be changed. But I was thinking, this is just a statement to import the library.</p>

<p>How do you think? How should I need to refactor this?</p>