@itentialopensource/adapter-kubernetes 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc.js +12 -12
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +54 -19
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +244 -392
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +7126 -35
- package/adapterBase.js +1331 -50
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +1 -1
- package/entities/Admissionregistration/action.json +1 -1
- package/entities/Admissionregistration_v1beta1/action.json +19 -19
- package/entities/Apiextensions/action.json +1 -1
- package/entities/Apiextensions_v1beta1/action.json +13 -13
- package/entities/Apiregistration/action.json +1 -1
- package/entities/Apiregistration_v1/action.json +13 -13
- package/entities/Apiregistration_v1beta1/action.json +13 -13
- package/entities/Apis/action.json +1 -1
- package/entities/Apps/action.json +1 -1
- package/entities/Apps_v1/action.json +77 -77
- package/entities/Apps_v1beta1/action.json +47 -47
- package/entities/Apps_v1beta2/action.json +77 -77
- package/entities/Auditregistration/action.json +1 -1
- package/entities/Auditregistration_v1alpha1/action.json +10 -10
- package/entities/Authentication/action.json +1 -1
- package/entities/Authentication_v1/action.json +2 -2
- package/entities/Authentication_v1beta1/action.json +2 -2
- package/entities/Authorization/action.json +1 -1
- package/entities/Authorization_v1/action.json +5 -5
- package/entities/Authorization_v1beta1/action.json +5 -5
- package/entities/Autoscaling/action.json +1 -1
- package/entities/Autoscaling_v1/action.json +15 -15
- package/entities/Autoscaling_v2beta1/action.json +15 -15
- package/entities/Autoscaling_v2beta2/action.json +15 -15
- package/entities/Batch/action.json +1 -1
- package/entities/Batch_v1/action.json +15 -15
- package/entities/Batch_v1beta1/action.json +15 -15
- package/entities/Batch_v2alpha1/action.json +15 -15
- package/entities/Certificates/action.json +1 -1
- package/entities/Certificates_v1beta1/action.json +14 -14
- package/entities/Coordination/action.json +1 -1
- package/entities/Coordination_v1/action.json +12 -12
- package/entities/Coordination_v1beta1/action.json +12 -12
- package/entities/Core/action.json +1 -1
- package/entities/Core_v1/action.json +240 -240
- package/entities/Events/action.json +1 -1
- package/entities/Events_v1beta1/action.json +12 -12
- package/entities/Extensions/action.json +1 -1
- package/entities/Extensions_v1beta1/action.json +87 -87
- package/entities/Logs/action.json +2 -2
- package/entities/Networking/action.json +1 -1
- package/entities/Networking_v1/action.json +12 -12
- package/entities/Networking_v1beta1/action.json +15 -15
- package/entities/Node/action.json +1 -1
- package/entities/Node_v1alpha1/action.json +10 -10
- package/entities/Node_v1beta1/action.json +10 -10
- package/entities/Policy/action.json +1 -1
- package/entities/Policy_v1beta1/action.json +24 -24
- package/entities/RbacAuthorization/action.json +1 -1
- package/entities/RbacAuthorization_v1/action.json +41 -41
- package/entities/RbacAuthorization_v1alpha1/action.json +41 -41
- package/entities/RbacAuthorization_v1beta1/action.json +41 -41
- package/entities/Scheduling/action.json +1 -1
- package/entities/Scheduling_v1/action.json +10 -10
- package/entities/Scheduling_v1alpha1/action.json +10 -10
- package/entities/Scheduling_v1beta1/action.json +10 -10
- package/entities/Settings/action.json +1 -1
- package/entities/Settings_v1alpha1/action.json +12 -12
- package/entities/Storage/action.json +1 -1
- package/entities/Storage_v1/action.json +22 -22
- package/entities/Storage_v1alpha1/action.json +10 -10
- package/entities/Storage_v1beta1/action.json +37 -37
- package/entities/Version/action.json +1 -1
- package/error.json +12 -0
- package/package.json +47 -23
- package/pronghorn.json +642 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +505 -11
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1594225120157.json +95 -0
- package/report/updateReport1615248177783.json +95 -0
- package/report/updateReport1653089036005.json +120 -0
- package/sampleProperties.json +110 -6
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +33 -96
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +643 -104
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +9 -14
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +179 -0
- package/utils/findPath.js +74 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +4 -1
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +190 -0
- package/gl-code-quality-report.json +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/* @copyright Itential, LLC 2020 */
|
|
2
|
+
/* eslint global-require: warn */
|
|
3
|
+
/* eslint no-console: warn */
|
|
4
|
+
/* eslint import/no-unresolved: warn */
|
|
5
|
+
/* eslint import/no-dynamic-require: warn */
|
|
6
|
+
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const rls = require('readline-sync');
|
|
9
|
+
const fs = require('fs-extra');
|
|
10
|
+
|
|
11
|
+
const utils = require(path.join(__dirname, 'tbUtils'));
|
|
12
|
+
const basicGet = require(path.join(__dirname, 'basicGet'));
|
|
13
|
+
const { name } = require(path.join(__dirname, '..', 'package.json'));
|
|
14
|
+
const sampleProperties = require(path.join(__dirname, '..', 'sampleProperties.json'));
|
|
15
|
+
|
|
16
|
+
// send interactive questions and collection answers
|
|
17
|
+
// return updated connection object
|
|
18
|
+
const collectAnswersSync = (questions, props) => {
|
|
19
|
+
const answers = [];
|
|
20
|
+
questions.forEach((q) => {
|
|
21
|
+
const answer = rls.question(q);
|
|
22
|
+
answers.push(answer);
|
|
23
|
+
});
|
|
24
|
+
return utils.getNewProps(answers, props);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// change object into array of questions
|
|
28
|
+
const confirm = (props) => {
|
|
29
|
+
const questions = Object.keys(props).map((key) => `${key}: (${props[key]}) `);
|
|
30
|
+
return collectAnswersSync(questions, props);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// allow user to change auth_method
|
|
34
|
+
const confirmAuthOptions = (authentication) => {
|
|
35
|
+
const authOptions = ['basic user_password', 'request_token', 'static_token', 'no_authentication'];
|
|
36
|
+
const displayAuthOptions = utils.getDisplayAuthOptions(authentication.auth_method, authOptions);
|
|
37
|
+
const index = rls.keyInSelect(displayAuthOptions, 'Which authentication?');
|
|
38
|
+
if (index === -1) {
|
|
39
|
+
return authentication.auth_method;
|
|
40
|
+
}
|
|
41
|
+
console.log(`${authOptions[index]} is selected.`);
|
|
42
|
+
return authOptions[index];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// helper function to update auth properties
|
|
46
|
+
const confirmAndUpdate = (auth, config) => {
|
|
47
|
+
const newAuth = confirm(auth);
|
|
48
|
+
return utils.updateAuth(newAuth, auth, config);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// extract basic auth properties
|
|
52
|
+
const updateBasicAuth = (config, authentication) => {
|
|
53
|
+
const auth = {
|
|
54
|
+
username: authentication.username,
|
|
55
|
+
password: authentication.password
|
|
56
|
+
};
|
|
57
|
+
return confirmAndUpdate(auth, config);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// extract static auth properties
|
|
61
|
+
const updateStaticAuth = (config, authentication) => {
|
|
62
|
+
const auth = {
|
|
63
|
+
token: authentication.token,
|
|
64
|
+
auth_field: authentication.auth_field,
|
|
65
|
+
auth_field_format: authentication.auth_field_format
|
|
66
|
+
};
|
|
67
|
+
return confirmAndUpdate(auth, config);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// troubleshooting connection and healthcheck endpoint setting of adapter
|
|
71
|
+
const VerifyHealthCheckEndpoint = (serviceItem, props, scriptFlag) => {
|
|
72
|
+
// Updates connectivity params and runs connectivity
|
|
73
|
+
let connConfig;
|
|
74
|
+
const result = {};
|
|
75
|
+
if (scriptFlag) {
|
|
76
|
+
const connection = utils.getConnection(serviceItem.properties);
|
|
77
|
+
const newConnection = confirm(connection);
|
|
78
|
+
utils.runConnectivity(newConnection.host, scriptFlag);
|
|
79
|
+
connConfig = utils.updateNewConnection(serviceItem, newConnection);
|
|
80
|
+
} else {
|
|
81
|
+
let { properties: { properties: { host } } } = serviceItem;
|
|
82
|
+
if (props.connProps) {
|
|
83
|
+
connConfig = utils.updateNewConnection(serviceItem, props.connProps);
|
|
84
|
+
host = connConfig.properties.properties.host;
|
|
85
|
+
} else {
|
|
86
|
+
connConfig = serviceItem;
|
|
87
|
+
}
|
|
88
|
+
result.connectivity = utils.runConnectivity(host, scriptFlag);
|
|
89
|
+
}
|
|
90
|
+
// Updates the healthcheck endpoing
|
|
91
|
+
const healthcheck = require('../entities/.system/action.json');
|
|
92
|
+
const healthCheckEndpoint = utils.getHealthCheckEndpoint(healthcheck);
|
|
93
|
+
let newHealthCheckEndpoint = healthCheckEndpoint;
|
|
94
|
+
if (scriptFlag) {
|
|
95
|
+
newHealthCheckEndpoint = confirm(healthCheckEndpoint);
|
|
96
|
+
utils.getHealthCheckEndpointURL(newHealthCheckEndpoint, connConfig);
|
|
97
|
+
} else if (props.healthCheckEndpoint) {
|
|
98
|
+
newHealthCheckEndpoint = props.healthCheckEndpoint;
|
|
99
|
+
}
|
|
100
|
+
// Updates the authorization params
|
|
101
|
+
const { authentication } = connConfig.properties.properties;
|
|
102
|
+
let updatedAdapter = connConfig;
|
|
103
|
+
if (scriptFlag) {
|
|
104
|
+
authentication.auth_method = confirmAuthOptions(authentication);
|
|
105
|
+
if (authentication.auth_method === 'basic user_password') {
|
|
106
|
+
updatedAdapter = updateBasicAuth(connConfig, authentication);
|
|
107
|
+
} else if (authentication.auth_method === 'static_token') {
|
|
108
|
+
updatedAdapter = updateStaticAuth(connConfig, authentication);
|
|
109
|
+
} else if (authentication.auth_method === 'request_token') {
|
|
110
|
+
console.log('current troubleshooting script does not support updating request_token authentication');
|
|
111
|
+
}
|
|
112
|
+
} else if (props.auth) {
|
|
113
|
+
updatedAdapter = utils.updateAuth(props.auth, authentication, connConfig);
|
|
114
|
+
}
|
|
115
|
+
// Writes the new healthcheck endpoint into action.json
|
|
116
|
+
utils.updateHealthCheckEndpoint(newHealthCheckEndpoint, healthCheckEndpoint, healthcheck);
|
|
117
|
+
return { result, updatedAdapter };
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const offline = async () => {
|
|
121
|
+
console.log('Start offline troubleshooting');
|
|
122
|
+
const { updatedAdapter } = VerifyHealthCheckEndpoint({ properties: sampleProperties }, {}, true);
|
|
123
|
+
const a = basicGet.getAdapterInstance(updatedAdapter);
|
|
124
|
+
const res = await utils.healthCheck(a);
|
|
125
|
+
if (!res) {
|
|
126
|
+
console.log('run `npm run troubleshoot` again to update settings');
|
|
127
|
+
process.exit(0);
|
|
128
|
+
}
|
|
129
|
+
console.log('Save changes to sampleProperties.json');
|
|
130
|
+
await fs.writeFile('sampleProperties.json', JSON.stringify(updatedAdapter.properties, null, 2));
|
|
131
|
+
if (rls.keyInYN('Test with more GET request')) {
|
|
132
|
+
await utils.runBasicGet(true);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const troubleshoot = async (props, scriptFlag, persistFlag, adapter) => {
|
|
137
|
+
// get database connection and existing adapter config
|
|
138
|
+
const { database, serviceItem } = await utils.getAdapterConfig();
|
|
139
|
+
// where troubleshoot should start
|
|
140
|
+
if (serviceItem) {
|
|
141
|
+
if (!scriptFlag || rls.keyInYN(`Start verifying the connection and authentication properties for ${name}?`)) {
|
|
142
|
+
const { result, updatedAdapter } = VerifyHealthCheckEndpoint(serviceItem, props, scriptFlag);
|
|
143
|
+
let a;
|
|
144
|
+
if (scriptFlag) {
|
|
145
|
+
a = basicGet.getAdapterInstance(updatedAdapter);
|
|
146
|
+
} else {
|
|
147
|
+
a = adapter;
|
|
148
|
+
}
|
|
149
|
+
const healthRes = await utils.healthCheck(a);
|
|
150
|
+
result.healthCheck = healthRes;
|
|
151
|
+
if (scriptFlag && !healthRes) {
|
|
152
|
+
console.log('run `npm run troubleshoot` again to update settings');
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (persistFlag && healthRes) {
|
|
157
|
+
const update = { $set: { properties: updatedAdapter.properties } };
|
|
158
|
+
await database.collection(utils.SERVICE_CONFIGS_COLLECTION).updateOne(
|
|
159
|
+
{ model: name }, update
|
|
160
|
+
);
|
|
161
|
+
if (scriptFlag) {
|
|
162
|
+
console.log(`${name} updated.`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (scriptFlag) {
|
|
166
|
+
if (rls.keyInYN('Test with more GET request')) {
|
|
167
|
+
await utils.runBasicGet(scriptFlag);
|
|
168
|
+
process.exit(0);
|
|
169
|
+
} else {
|
|
170
|
+
console.log('Exiting');
|
|
171
|
+
process.exit(0);
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
result.basicGet = await utils.runBasicGet(scriptFlag);
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
console.log('You can update healthCheckEndpoint in ./entities/.system/action.json');
|
|
179
|
+
console.log('You can update authentication credientials under Settings/Services');
|
|
180
|
+
console.log('Exiting');
|
|
181
|
+
process.exit(0);
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
console.log(`${name} not installed`);
|
|
185
|
+
console.log('run `npm run install:adapter` to install current adapter to IAP first. Exiting...');
|
|
186
|
+
}
|
|
187
|
+
return null;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
module.exports = { troubleshoot, offline };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `adapterBase.js` has 256 lines of code (exceeds 250 allowed). Consider refactoring.","fingerprint":"bca8c6597d0017e6fa30475be760d821","location":{"path":"adapterBase.js","lines":{"begin":1,"end":502}},"other_locations":[],"remediation_points":1286400,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Function `refreshProperties` has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.","fingerprint":"d180b5c12d811e967bc2c574ef2dc60c","location":{"path":"adapterBase.js","lines":{"begin":93,"end":147}},"other_locations":[],"remediation_points":850000,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Function `entityInList` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","fingerprint":"97cd33b12fcd26f1e7d1aebdd2da9c73","location":{"path":"adapterBase.js","lines":{"begin":400,"end":421}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Function `capabilityResults` has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.","fingerprint":"d7470f546ecbe221975ac929ef9eee00","location":{"path":"adapterBase.js","lines":{"begin":432,"end":478}},"other_locations":[],"remediation_points":1450000,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `refreshProperties` has 37 lines of code (exceeds 25 allowed). Consider refactoring.","fingerprint":"74de15911bfbe0399149c624fd2c735b","location":{"path":"adapterBase.js","lines":{"begin":93,"end":147}},"other_locations":[],"remediation_points":888000,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `capabilityResults` has 35 lines of code (exceeds 25 allowed). Consider refactoring.","fingerprint":"c4f3e62cf443a71df39902cd8d2e41e6","location":{"path":"adapterBase.js","lines":{"begin":432,"end":478}},"other_locations":[],"remediation_points":840000,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Function `createBundle` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","fingerprint":"4b87ca4c88a7ecbdbbb08bf5112475f0","location":{"path":"utils/artifactize.js","lines":{"begin":7,"end":134}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `createBundle` has 96 lines of code (exceeds 25 allowed). Consider refactoring.","fingerprint":"72b872bcc26c772c56329ae356a8b28d","location":{"path":"utils/artifactize.js","lines":{"begin":7,"end":134}},"other_locations":[],"remediation_points":2304000,"severity":"major","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `replaceTestVars` has 54 lines of code (exceeds 25 allowed). Consider refactoring.","fingerprint":"8d8c6f1b4fa974629cf80c425e841e1d","location":{"path":"utils/testRunner.js","lines":{"begin":41,"end":118}},"other_locations":[],"remediation_points":1296000,"severity":"major","type":"issue","engine_name":"structure"},{"categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `runTest` has 29 lines of code (exceeds 25 allowed). Consider refactoring.","fingerprint":"8c21202bfdbe9e2506f2dd1458400d09","location":{"path":"utils/testRunner.js","lines":{"begin":123,"end":156}},"other_locations":[],"remediation_points":696000,"severity":"minor","type":"issue","engine_name":"structure"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 3 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/testRunner.js","lines":{"begin":204,"end":206}},"remediation_points":390000,"other_locations":[{"path":"utils/testRunner.js","lines":{"begin":207,"end":209}},{"path":"utils/testRunner.js","lines":{"begin":216,"end":218}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 48**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"13dfbb7f3dbfa28ed2c51d9ea6819363","severity":"minor","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 3 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/testRunner.js","lines":{"begin":207,"end":209}},"remediation_points":390000,"other_locations":[{"path":"utils/testRunner.js","lines":{"begin":204,"end":206}},{"path":"utils/testRunner.js","lines":{"begin":216,"end":218}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 48**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"13dfbb7f3dbfa28ed2c51d9ea6819363","severity":"minor","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 3 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/testRunner.js","lines":{"begin":216,"end":218}},"remediation_points":390000,"other_locations":[{"path":"utils/testRunner.js","lines":{"begin":204,"end":206}},{"path":"utils/testRunner.js","lines":{"begin":207,"end":209}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 48**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"13dfbb7f3dbfa28ed2c51d9ea6819363","severity":"minor","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/artifactize.js","lines":{"begin":31,"end":33}},"remediation_points":1020000,"other_locations":[{"path":"utils/artifactize.js","lines":{"begin":36,"end":38}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 69**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"20102ffc15f005287958e9466fe4f5fc","severity":"major","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/artifactize.js","lines":{"begin":36,"end":38}},"remediation_points":1020000,"other_locations":[{"path":"utils/artifactize.js","lines":{"begin":31,"end":33}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 69**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"20102ffc15f005287958e9466fe4f5fc","severity":"major","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"adapterBase.js","lines":{"begin":172,"end":177}},"remediation_points":360000,"other_locations":[{"path":"adapterBase.js","lines":{"begin":182,"end":187}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 47**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"836f40773e426a4c05734c35951c294b","severity":"minor","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"adapterBase.js","lines":{"begin":182,"end":187}},"remediation_points":360000,"other_locations":[{"path":"adapterBase.js","lines":{"begin":172,"end":177}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 47**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"836f40773e426a4c05734c35951c294b","severity":"minor","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/testRunner.js","lines":{"begin":219,"end":225}},"remediation_points":300000,"other_locations":[{"path":"utils/testRunner.js","lines":{"begin":234,"end":240}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 45**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"d5d99e77b82f74c885fd703de34ea657","severity":"minor","engine_name":"duplication"},{"type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"utils/testRunner.js","lines":{"begin":234,"end":240}},"remediation_points":300000,"other_locations":[{"path":"utils/testRunner.js","lines":{"begin":219,"end":225}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 45**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"fingerprint":"d5d99e77b82f74c885fd703de34ea657","severity":"minor","engine_name":"duplication"}]
|