There's some variable definition consistency issues (use camelCase), variable scope shadowing issues, and other minor hygiene like line length and using !== instead of !=
yarn run v1.15.2
$ vue-cli-service lint
/code/src/api/handler.ts
!= should be !== (triple-equals)
8 | export function getCookie(name) {
9 | let cookieValue: null | string = null;
> 10 | if (document.cookie && document.cookie != '') {
| ^
11 | const cookies = document.cookie.split(';');
12 | for (let i = 0; i < cookies.length; i++) {
13 | const cookie = _.trim(cookies[i]);
Expected a 'for-of' loop instead of a 'for' loop with this simple iteration (prefer-for-of)
10 | if (document.cookie && document.cookie != '') {
11 | const cookies = document.cookie.split(';');
> 12 | for (let i = 0; i < cookies.length; i++) {
| ^
13 | const cookie = _.trim(cookies[i]);
14 | // Does this cookie string begin with the name we want?
15 | if (cookie.substring(0, name.length + 1) == (name + '=')) {
== should be === (triple-equals)
13 | const cookie = _.trim(cookies[i]);
14 | // Does this cookie string begin with the name we want?
> 15 | if (cookie.substring(0, name.length + 1) == (name + '=')) {
| ^
16 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
17 | break;
18 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
39 | handleSuccessWithoutDataResponse(response: AxiosResponse): void;
40 |
> 41 | handleOtherError(network_error): void;
| ^
42 |
43 | handleServerValidationError(response: { response: AxiosResponse }): void;
44 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
53 | }
54 |
> 55 | export function baseHandleOtherError(response_or_network_error): string {
| ^
56 | let msg: string;
57 | if (!_.isUndefined(response_or_network_error.response)) {
58 | switch (response_or_network_error.response.status) {
Exceeds maximum line length of 120 (max-line-length)
57 | if (!_.isUndefined(response_or_network_error.response)) {
58 | switch (response_or_network_error.response.status) {
> 59 | case 403: msg = 'Server Forbidden Error (tried to read, create or modify something you do not have permission to)'; break;
60 | case 404: msg = 'Server Resource Not Found Error (tried to read, create or modify something that does not exist)'; break;
61 | case 500: msg = 'Internal Server Error (server has a bug)'; break;
62 | default: msg = `HTTP Error (${response_or_network_error.response.status})`; break;
Exceeds maximum line length of 120 (max-line-length)
58 | switch (response_or_network_error.response.status) {
59 | case 403: msg = 'Server Forbidden Error (tried to read, create or modify something you do not have permission to)'; break;
> 60 | case 404: msg = 'Server Resource Not Found Error (tried to read, create or modify something that does not exist)'; break;
61 | case 500: msg = 'Internal Server Error (server has a bug)'; break;
62 | default: msg = `HTTP Error (${response_or_network_error.response.status})`; break;
63 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
101 | }
102 |
> 103 | public handleOtherError(response_or_network_error) {
| ^
104 | const msg = baseHandleOtherError(response_or_network_error);
105 | this.component.statusMessages = [{classNames: 'alert alert-danger', message: msg}];
106 | }
A maximum of 1 class per file is allowed. (max-classes-per-file)
120 | }
121 |
> 122 | export class HandlerShowSuccessMessage implements CreateOrUpdateHandler {
123 | constructor(public component: FormComponent) {
124 | }
125 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
138 | }
139 |
> 140 | public handleOtherError(response_or_network_error) {
| ^
141 | const msg = baseHandleOtherError(response_or_network_error);
142 | this.component.statusMessages = [{classNames: 'alert alert-danger', message: msg}];
143 | }
A maximum of 1 class per file is allowed. (max-classes-per-file)
164 | }
165 |
> 166 | export class DismissOnSuccessHandler implements CreateOrUpdateHandler {
167 | constructor(public component: FormComponent, public modalId: string) {
168 | }
169 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
172 | }
173 |
> 174 | public handleOtherError(response_or_network_error) {
| ^
175 | let msg;
176 | if (!_.isUndefined(response_or_network_error.response)) {
177 | switch (response_or_network_error.response.status) {
Exceeds maximum line length of 120 (max-line-length)
176 | if (!_.isUndefined(response_or_network_error.response)) {
177 | switch (response_or_network_error.response.status) {
> 178 | case 403: msg = 'Server Forbidden Error (tried to readm create or modify something you do not have permission to)'; break;
179 | case 404: msg = 'Server Resource Not Found Error (tried to read, create or modify something that does not exist)'; break;
180 | case 500: msg = 'Internal Server Error (server has a bug)'; break;
181 | default: msg = `HTTP Error (${response_or_network_error.response.status})`; break;
Exceeds maximum line length of 120 (max-line-length)
177 | switch (response_or_network_error.response.status) {
178 | case 403: msg = 'Server Forbidden Error (tried to readm create or modify something you do not have permission to)'; break;
> 179 | case 404: msg = 'Server Resource Not Found Error (tried to read, create or modify something that does not exist)'; break;
180 | case 500: msg = 'Internal Server Error (server has a bug)'; break;
181 | default: msg = `HTTP Error (${response_or_network_error.response.status})`; break;
182 | }
A maximum of 1 class per file is allowed. (max-classes-per-file)
209 | }
210 |
> 211 | export class Api {
212 | public axios: any;
213 |
214 | constructor(config?: AxiosRequestConfig) {
Shadowed name: 'config' (no-shadowed-variable)
220 | }
221 | this.axios = axios.create(config);
> 222 | this.axios.interceptors.request.use((config) => {
| ^
223 | config.headers['X-CSRFToken'] = getCookie('csrftoken');
224 | return config;
225 | }, (error) => Promise.reject(error));
Exceeds maximum line length of 120 (max-line-length)
230 | }
231 |
> 232 | public async postOrPut(method: 'post' | 'put', url: string, component: CreateOrUpdateHandler, config?: AxiosRequestConfig) {
233 | try {
234 | const response = await this.axios({method, url, data: component.state, config});
235 | component.handleSuccessWithDataResponse(response);
/code/src/api/index.ts
A maximum of 1 class per file is allowed. (max-classes-per-file)
38 | }
39 |
> 40 | export class EventAPI extends BaseAPI {
41 | public baseUrl() {
42 | return '/events/';
43 | }
A maximum of 1 class per file is allowed. (max-classes-per-file)
44 | }
45 |
> 46 | export class JobAPI extends BaseAPI {
47 | public baseUrl() {
48 | return '/jobs/';
49 | }
A maximum of 1 class per file is allowed. (max-classes-per-file)
50 | }
51 |
> 52 | export class ReviewEditorAPI {
53 | public baseUrl() {
54 | return '/reviews/';
55 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
55 | }
56 |
> 57 | public listInvitationsUrl(review_uuid) {
| ^
58 | return `${this.baseUrl()}${review_uuid}/editor/invitations/`;
59 | }
60 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
59 | }
60 |
> 61 | public listInvitations(review_uuid) {
| ^
62 | return api.get(this.listInvitationsUrl(review_uuid));
63 | }
64 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
63 | }
64 |
> 65 | public listFeedbackUrl(review_uuid) {
| ^
66 | return `${this.baseUrl()}${review_uuid}/editor/feedback/`;
67 | }
68 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
67 | }
68 |
> 69 | public listFeedback(review_uuid) {
| ^
70 | return api.get(this.listFeedbackUrl(review_uuid));
71 | }
72 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
83 | }
84 |
> 85 | public sendInvitation({review_uuid}, candidate_reviewer) {
| ^
86 | return api.axios.post(this.sendInvitationUrl({review_uuid}), candidate_reviewer);
87 | }
88 |
A maximum of 1 class per file is allowed. (max-classes-per-file)
104 | }
105 |
> 106 | export class ProfileAPI extends BaseAPI {
107 |
108 | public baseUrl() {
109 | return '/users/';
A maximum of 1 class per file is allowed. (max-classes-per-file)
136 | }
137 |
> 138 | export class CodebaseAPI extends BaseAPI {
139 | public baseUrl() {
140 | return '/codebases/';
141 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
153 | }
154 |
> 155 | public mediaDetailUrl(identifier, image_id) {
| ^
156 | return `${this.baseUrl()}${identifier}/media/${image_id}`;
157 | }
158 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
157 | }
158 |
> 159 | public mediaDelete(identifier, image_id) {
| ^
160 | return api.delete(this.mediaDetailUrl(identifier, image_id));
161 | }
162 |
A maximum of 1 class per file is allowed. (max-classes-per-file)
166 | }
167 |
> 168 | export class CodebaseReleaseAPI {
169 |
170 | public baseUrl() {
171 | return '/codebases/';
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
200 | }
201 |
> 202 | public publish({identifier, version_number}, publish_component) {
| ^
203 | return api.post(`${this.detailUrl({identifier, version_number})}publish/`, publish_component);
204 | }
205 |
A maximum of 1 class per file is allowed. (max-classes-per-file)
251 | }
252 |
> 253 | export class TagAPI {
254 |
255 | public static listUrl(params: TagQueryParameters) {
256 | return `/tags/?${queryString.stringify(params)}`;
A maximum of 1 class per file is allowed. (max-classes-per-file)
279 | }
280 |
> 281 | export class ContributorAPI {
282 |
283 | public static listUrl(filters: { query?: string, page: number }) {
284 | return `/contributors/?${queryString.stringify(filters)}`;
/code/src/api/mock_handler.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
11 | }
12 |
> 13 | public handleOtherError(response_or_network_error) {
| ^
14 | throw response_or_network_error;
15 | }
16 |
/code/src/common/browser-version-notifier.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
18 | })
19 | export class BrowserDetect extends Vue {
> 20 | public browser_warnings = {
| ^
21 | ie: 'All versions of Internet Explorer are unsupported. Some site functionality may not work.',
22 | chrome: `Chrome versions before ${MIN_CHROME_VERSION} are unsupported. Some site functionality may not work.`,
23 | };
Missing radix parameter (radix)
28 | get supported() {
29 | if (this.browser) {
> 30 | const version = parseInt(this.browser.version.split('.')[0]);
| ^
31 | if (this.browser.name === 'ie') {
32 | return false;
33 | } else if (this.browser.name === 'chrome' && version <= MIN_CHROME_VERSION) {
/code/src/common/index.ts
file should end with a newline (eofline)
> 1 | import 'common/browser-version-notifier';
| ^
/code/src/components/SortBy.vue
Exceeds maximum line length of 120 (max-line-length)
45 | this.sortByAscDesc = 'desc';
46 | } else {
> 47 | this.selectedOptionValue = _.isArray(orderingQueryParam) ? orderingQueryParam.join(',') : orderingQueryParam;
48 | this.sortByAscDesc = 'asc';
49 | }
50 | }
/code/src/components/confirmation_modal.ts
Exceeds maximum line length of 120 (max-line-length)
5 |
6 | @Component({
> 7 | template: `<div class="modal fade" :id="modalId" tabindex="-1" role="dialog" :aria-labelledby="modalLabelId" aria-hidden="true">
8 | <div class="modal-dialog" role="document">
9 | <div class="modal-content">
10 | <div class="modal-header">
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
33 | export class ConfirmationModal extends Vue {
34 | @Prop({default: true})
> 35 | public ajax_submit: boolean;
| ^
36 |
37 | @Prop()
38 | public title: string;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
42 |
43 | @Prop()
> 44 | public base_name: string;
| ^
45 |
46 | public errors: string[] = [];
47 |
/code/src/components/edit_items.ts
Exceeds maximum line length of 120 (max-line-length)
8 | <label :class="['form-control-label', requiredClass]">{{ label }}</label>
9 | </slot>
> 10 | <input :class="['form-control', {'is-invalid': isInvalid}]" v-model="potential_item" @keyup.enter="create" :placeholder="placeholder">
11 | <draggable :list="value" @start="drag=true" @end="drag=false">
12 | <div v-for="(item, index) in value" :key="index" class="input-group">
13 | <input :value="item" @input="$emit('modify', { index, value: $event.target.value})" class="form-control">
Exceeds maximum line length of 120 (max-line-length)
11 | <draggable :list="value" @start="drag=true" @end="drag=false">
12 | <div v-for="(item, index) in value" :key="index" class="input-group">
> 13 | <input :value="item" @input="$emit('modify', { index, value: $event.target.value})" class="form-control">
14 | <button type="button" class="input-group-addon" tabindex="-1" @click="$emit('remove', index)">Delete</button>
15 | </div>
16 | </draggable>
Exceeds maximum line length of 120 (max-line-length)
12 | <div v-for="(item, index) in value" :key="index" class="input-group">
13 | <input :value="item" @input="$emit('modify', { index, value: $event.target.value})" class="form-control">
> 14 | <button type="button" class="input-group-addon" tabindex="-1" @click="$emit('remove', index)">Delete</button>
15 | </div>
16 | </draggable>
17 | <div v-if="isInvalid" class="invalid-feedback">
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
35 |
36 | public drag: boolean = false;
> 37 | public potential_item: string = '';
| ^
38 |
39 | public create() {
40 | this.$emit('create', this.potential_item);
/code/src/components/forms/DatePicker.vue
Missing radix parameter (radix)
57 | }
58 | const [yearStr, monthStr, dayStr] = this.value.split('-');
> 59 | const year = parseInt(yearStr);
| ^
60 | const month = parseInt(monthStr) - 1; // month argument is zero indexed so 0 is January
61 | const day = parseInt(dayStr.split('T')[0]);
62 | return new Date(year, month, day);
Missing radix parameter (radix)
58 | const [yearStr, monthStr, dayStr] = this.value.split('-');
59 | const year = parseInt(yearStr);
> 60 | const month = parseInt(monthStr) - 1; // month argument is zero indexed so 0 is January
| ^
61 | const day = parseInt(dayStr.split('T')[0]);
62 | return new Date(year, month, day);
63 | }
Missing radix parameter (radix)
59 | const year = parseInt(yearStr);
60 | const month = parseInt(monthStr) - 1; // month argument is zero indexed so 0 is January
> 61 | const day = parseInt(dayStr.split('T')[0]);
| ^
62 | return new Date(year, month, day);
63 | }
64 |
/code/src/components/forms/checkbox.ts
Exceeds maximum line length of 120 (max-line-length)
5 | template: `<div class="form-check">
6 | <label :for='controlId' class="form-check-label">
> 7 | <input :id='controlId' type="checkbox" :name="name" :class="['form-check-input', {'is-invalid': isInvalid}]" :value="value" :checked="value === true"
8 | @change="toggle($event.target.value)">
9 | <slot name="label" :label="label">
10 | <span :class="[requiredClass]">{{ label }}</span>
/code/src/components/forms/datepicker.ts
Missing radix parameter (radix)
52 | }
53 | const [yearStr, monthStr, dayStr] = this.value.split('-');
> 54 | const year = parseInt(yearStr);
| ^
55 | const month = parseInt(monthStr) - 1; // month argument is zero indexed so 0 is January
56 | const day = parseInt(dayStr.split('T')[0]);
57 | return new Date(year, month, day);
Missing radix parameter (radix)
53 | const [yearStr, monthStr, dayStr] = this.value.split('-');
54 | const year = parseInt(yearStr);
> 55 | const month = parseInt(monthStr) - 1; // month argument is zero indexed so 0 is January
| ^
56 | const day = parseInt(dayStr.split('T')[0]);
57 | return new Date(year, month, day);
58 | }
Missing radix parameter (radix)
54 | const year = parseInt(yearStr);
55 | const month = parseInt(monthStr) - 1; // month argument is zero indexed so 0 is January
> 56 | const day = parseInt(dayStr.split('T')[0]);
| ^
57 | return new Date(year, month, day);
58 | }
59 |
/code/src/components/forms/input.ts
Exceeds maximum line length of 120 (max-line-length)
7 | <label :for='controlId' :class="['form-control-label', requiredClass]">{{ label }}</label>
8 | </slot>
> 9 | <input :id='controlId' :type="type" :name="name" :class="['form-control', {'is-invalid': isInvalid}]" :value="value"
10 | @input="updateValue($event.target.value)">
11 | <div class="invalid-feedback">
12 | {{ errorMessage }}
/code/src/components/forms/markdown.ts
Exceeds maximum line length of 120 (max-line-length)
17 | <div v-if="isInvalid" class="invalid-feedback">{{ errorMessage }}</div>
18 | <slot name="help" :help="help">
> 19 | <small style='margin-top: -30px;' class="form-text text-muted"><a href="https://en.wikipedia.org/wiki/Markdown" target="_blank">Markdown</a> styling is supported</small>
20 | <small class="form-text text-muted">{{ help }}</small>
21 | </slot>
22 | </div>`,
/code/src/components/tagger.ts
A maximum of 1 class per file is allowed. (max-classes-per-file)
75 | }
76 |
> 77 | export class EventTagger extends Tagger {
78 |
79 | public list(query) {
80 | return TagAPI.listEventTags({query});
A maximum of 1 class per file is allowed. (max-classes-per-file)
83 | }
84 |
> 85 | export class JobTagger extends Tagger {
86 |
87 | public list(query) {
88 | return TagAPI.listJobTags({query});
A maximum of 1 class per file is allowed. (max-classes-per-file)
91 | }
92 |
> 93 | export class CodebaseTagger extends Tagger {
94 |
95 | public list(query) {
96 | return TagAPI.listCodebaseTags({query});
A maximum of 1 class per file is allowed. (max-classes-per-file)
99 | }
100 |
> 101 | export class ProfileTagger extends Tagger {
102 |
103 | public list(query) {
104 | return TagAPI.listProfileTags({query});
/code/src/pages/codebase/Edit.vue
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
62 | export default class Description extends createFormValidator(schema) {
63 | @Prop({default: null})
> 64 | public _identifier: string;
| ^
65 |
66 | @Prop({default: null})
67 | public redirect: string | null;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
69 | public detailPageUrl(state) {
70 | this.state.identifier = state.identifier;
> 71 | const version_number = this.state.latest_version_number || '1.0.0';
| ^
72 | if (_.isNull(this._identifier)) {
73 | return releaseApi.editUrl({identifier: this.state.identifier, version_number});
74 | } else {
/code/src/pages/codebase/index.ts
Calls to 'console.log' are not allowed. (no-console)
10 |
11 | const editCodebase = new EditCodebase({ propsData: extractUrlParams(window.location.pathname)}).$mount('#app');
> 12 | console.log({editCodebase});
13 |
/code/src/pages/codebase/list.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
3 | import * as queryString from 'query-string';
4 |
> 5 | const _queryParams = queryString.parse(window.location.search);
| ^
6 | new SearchCodebases().$mount('#sidebar');
7 | new SortBy({
8 | propsData: {
/code/src/pages/codebase/release/contributors.ts
Calls to 'console.error' are not allowed. (no-console)
32 | } catch (e) {
33 | self.isLoading = false;
> 34 | console.error(e);
| ^
35 | }
36 | }, 800);
37 |
Exceeds maximum line length of 120 (max-line-length)
55 |
56 | export const releaseContributorSchema = yup.object().shape({
> 57 | contributor: yup.mixed().test('is-not-null', '${path} must have a value', (value) => !_.isNull(value)).label('this'),
58 | roles: yup.array().of(yup.string()).min(1).label('affiliations'),
59 | });
60 |
Exceeds maximum line length of 120 (max-line-length)
106 | :required="config.given_name">
107 | </c-input>
> 108 | <c-input name="middle_name" v-model="middle_name" label="Middle Name" :errorMsgs="errors.middle_name"
109 | :required="config.middle_name">
110 | </c-input>
111 | <c-input name="family_name" v-model="family_name" label="Family Name" :errorMsgs="errors.family_name"
Exceeds maximum line length of 120 (max-line-length)
109 | :required="config.middle_name">
110 | </c-input>
> 111 | <c-input name="family_name" v-model="family_name" label="Family Name" :errorMsgs="errors.family_name"
112 | :required="config.family_name">
113 | </c-input>
114 | <c-input name="email" v-model="email" label="Email Address" :errorMsgs="errors.email"
Exceeds maximum line length of 120 (max-line-length)
123 | :required="config.affiliations"
124 | label="Affiliations"
> 125 | help="The institution(s) this contributor is affiliated with. You must press enter to add an affiliation.">
126 | </c-edit-affiliations>
127 | <label for="contributorType" class="form-control-label">
128 | Contributor Type
Exceeds maximum line length of 120 (max-line-length)
132 | <option>organization</option>
133 | </select>
> 134 | <div v-if="errors.type.length > 0" class="invalid-feedback-always">{{ errors.type.join(', ') }}</div>
135 | </div>
136 | <div class="modal-footer">
137 | <button type="button" class="btn btn-secondary" @click="cancel">Cancel</button>
A maximum of 1 class per file is allowed. (max-classes-per-file)
183 | }
184 |
> 185 | @Component({
186 | template: `<div class="card mt-2">
187 | <div class="card-header">
188 | <h5 class='card-title'>Add or edit a Release Contributor</h5>
Exceeds maximum line length of 120 (max-line-length)
209 | </div>
210 | <div class="col-3">
> 211 | <button class="btn btn-block btn-primary" @click="$emit('editContributor', state.contributor)"><i class='fa fa-plus'></i> Add a new contributor</button>
212 | </div>
213 | </div>
214 | <div class="invalid-feedback" v-show="errors.contributor">
Exceeds maximum line length of 120 (max-line-length)
231 | <div class='d-flex justify-content-end'>
232 | <button type="button" class="btn btn-secondary" @click="cancel" v-show="hasEdits">Cancel</button>
> 233 | <button type="button" class="ml-auto btn btn-primary" @click="save"><i class='fa fa-user-plus'></i> Register citable contributor</button>
234 | </div>
235 | </div>
236 | </div>`,
A maximum of 1 class per file is allowed. (max-classes-per-file)
306 |
307 |
> 308 | class ContributorResponseHandler extends HandlerShowSuccessMessage {
309 | public updateListServerValidationMessage(errors) {
310 | this.component.statusMessages = _.concat({
311 | classNames: 'alert alert-danger',
Exceeds maximum line length of 120 (max-line-length)
320 | return {
321 | classNames: 'alert alert-danger',
> 322 | message: `${displayContributorLabel(value.releaseContributor.contributor)}: ${JSON.stringify(value.error)}`,
323 | };
324 | }));
325 | }
A maximum of 1 class per file is allowed. (max-classes-per-file)
326 | }
327 |
> 328 | @Component({
329 | // language=Vue
330 | template: `<div>
331 | <p class='mt-3'>
Exceeds maximum line length of 120 (max-line-length)
332 | Please list the contributors that should be included in a citation for this software release. Ordering is
333 | important, as is the role of the contributor. You can drag and drop release contributors via the
> 334 | <i class='fa fa-exchange'></i> button to change the order in which they appear, edit them <i class='fa fa-edit'></i>, or
335 | remove them <i class='fa fa-remove'></i>.
336 | </p>
337 | <p>By default, we will always add the submitter (you) as a release contributor. There must be at least one
Exceeds maximum line length of 120 (max-line-length)
342 | You can add new contributors via the form below. If you can't find an existing Contributor in our system,
343 | you can add a new one via the
> 344 | <button class='btn btn-primary btn-sm'><i class='fa fa-plus'></i></button> button. After you've selected a contributor, click the
345 | <button class='btn btn-sm btn-primary'><i class='fa fa-user-plus'></i> Register</button> button to register
346 | them as a cited contributor to this release.
347 | </div>
Exceeds maximum line length of 120 (max-line-length)
357 | <draggable v-model="state" v-if="state.length > 0" @end="refreshStatusMessage">
358 | <ul v-for="releaseContributor in state" :key="releaseContributor._id" class="list-group">
> 359 | <li :class="['list-group-item d-flex justify-content-between', { 'list-group-item-warning': releaseContributor.edited}]">
360 | <div>
361 | <span class="btn btn-sm fa fa-exchange"></span>
362 | {{ releaseContributorLabel(releaseContributor) }}
Exceeds maximum line length of 120 (max-line-length)
418 | public releaseContributorLabel(releaseContributor: CodebaseContributor) {
419 | const name = displayContributorLabel(releaseContributor.contributor);
> 420 | const roles = releaseContributor.roles.length > 0 ? ` (${releaseContributor.roles.map(this.roleLabel).join(', ')})` : '';
421 | return `${name}${roles}`;
422 | }
423 |
Calls to 'console.assert' are not allowed. (no-console)
427 |
428 | public matchesState(states: Array<keyof typeof FormContributorState>) {
> 429 | console.assert(states.length > 0);
| ^
430 | for (const state of states) {
431 | if (FormContributorState[state] === this.formState) {
432 | return true;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
465 | // Release Contributor
466 |
> 467 | public createOrReplaceReleaseContributor(release_contributor: CodebaseContributor) {
| ^
468 | const ind = _.findIndex(this.state, (rc) => release_contributor._id === rc._id);
469 | if (ind !== -1) {
470 | this.state[ind] = _.merge({}, release_contributor);
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
500 | }
501 |
> 502 | public deleteReleaseContributor(_id: string) {
| ^
503 | const index = _.findIndex(this.state, (rc) => rc._id === _id);
504 | this.state.splice(index, 1);
505 | this.refreshStatusMessage();
/code/src/pages/codebase/release/detail.ts
Exceeds maximum line length of 120 (max-line-length)
39 | label="Release Notes" :required="config.release_notes">
40 | </c-markdown>
> 41 | <c-datepicker v-model="embargo_end_date" :errorMsgs="errors.embargo_end_date" name="embargoEndDate" :clearButton="true"
42 | :required="config.embargo_end_date"
43 | label="Embargo End Date"
44 | help="The date your private release will be automatically made public">
Exceeds maximum line length of 120 (max-line-length)
58 | </div>
59 | <c-tagger v-model="platforms" placeholder="Software frameworks used by this model" :required="false"
> 60 | label="Software Framework(s)" help="Modeling software frameworks (e.g., NetLogo, RePast, Mason, CORMAS, Mesa, etc.) used by this model" :errorMsgs="errors.platforms">
61 | </c-tagger>
62 | <c-tagger v-model="programming_languages" placeholder="Programming languages used by this model" :required="config.programming_languages"
63 | label="Programming Languages" help="Programming languages used in this model" :errorMsgs="errors.programming_languages">
Exceeds maximum line length of 120 (max-line-length)
60 | label="Software Framework(s)" help="Modeling software frameworks (e.g., NetLogo, RePast, Mason, CORMAS, Mesa, etc.) used by this model" :errorMsgs="errors.platforms">
61 | </c-tagger>
> 62 | <c-tagger v-model="programming_languages" placeholder="Programming languages used by this model" :required="config.programming_languages"
63 | label="Programming Languages" help="Programming languages used in this model" :errorMsgs="errors.programming_languages">
64 | </c-tagger>
65 | <div :class="['form-group', {'child-is-invalid': errors.license.length > 0}]">
Exceeds maximum line length of 120 (max-line-length)
61 | </c-tagger>
62 | <c-tagger v-model="programming_languages" placeholder="Programming languages used by this model" :required="config.programming_languages"
> 63 | label="Programming Languages" help="Programming languages used in this model" :errorMsgs="errors.programming_languages">
64 | </c-tagger>
65 | <div :class="['form-group', {'child-is-invalid': errors.license.length > 0}]">
66 | <label :class="['form-control-label', {'required': config.license }]">License</label>
Exceeds maximum line length of 120 (max-line-length)
65 | <div :class="['form-group', {'child-is-invalid': errors.license.length > 0}]">
66 | <label :class="['form-control-label', {'required': config.license }]">License</label>
> 67 | <multiselect v-model="license" label="name" track-by="name" placeholder="Type to find license" :options="licenseOptions">
68 | <template slot="option" slot-scope="props">
69 | <div>
70 | <a class='btn btn-sm btn-info' :href="props.option.url" target="_blank"><span class="fa fa-external-link"></span> view</a>
Exceeds maximum line length of 120 (max-line-length)
68 | <template slot="option" slot-scope="props">
69 | <div>
> 70 | <a class='btn btn-sm btn-info' :href="props.option.url" target="_blank"><span class="fa fa-external-link"></span> view</a>
71 | {{ props.option.name }}
72 | </div>
73 | </template>
/code/src/pages/codebase/release/index.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
3 | function extractParams(pathname: string) {
4 | const el = document.getElementById('app');
> 5 | const version_number = el.getAttribute('data-version-number');
| ^
6 | const identifier = el.getAttribute('data-identifier');
7 | const review_status_enum = JSON.parse(el.getAttribute('data-review-status-enum'));
8 | return {identifier, version_number, review_status_enum};
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
5 | const version_number = el.getAttribute('data-version-number');
6 | const identifier = el.getAttribute('data-identifier');
> 7 | const review_status_enum = JSON.parse(el.getAttribute('data-review-status-enum'));
| ^
8 | return {identifier, version_number, review_status_enum};
9 | }
10 |
/code/src/pages/codebase/release/progress.ts
A maximum of 1 class per file is allowed. (max-classes-per-file)
21 | }
22 |
> 23 | @Component({
24 | template: `<div class="container-fluid px-0">
25 | <div class="row">
26 | <div class="col-sm-12 col-md-6 col-lg-4" v-if="!published">
Exceeds maximum line length of 120 (max-line-length)
32 | <p class="card-text">
33 | <c-check label="At least one code file" :check="uploadProgress.code"></c-check>
> 34 | <c-check label="At least one narrative documentation file" :check="uploadProgress.docs"></c-check>
35 | <c-check label="At least one input data file (optional)" :check="uploadProgress.data"></c-check>
36 | <c-check label="At least one result file (optional)" :check="uploadProgress.results"></c-check>
37 | </p>
Exceeds maximum line length of 120 (max-line-length)
33 | <c-check label="At least one code file" :check="uploadProgress.code"></c-check>
34 | <c-check label="At least one narrative documentation file" :check="uploadProgress.docs"></c-check>
> 35 | <c-check label="At least one input data file (optional)" :check="uploadProgress.data"></c-check>
36 | <c-check label="At least one result file (optional)" :check="uploadProgress.results"></c-check>
37 | </p>
38 | </div>
Exceeds maximum line length of 120 (max-line-length)
34 | <c-check label="At least one narrative documentation file" :check="uploadProgress.docs"></c-check>
35 | <c-check label="At least one input data file (optional)" :check="uploadProgress.data"></c-check>
> 36 | <c-check label="At least one result file (optional)" :check="uploadProgress.results"></c-check>
37 | </p>
38 | </div>
39 | </div>
/code/src/pages/codebase/release/regenerate_share_uuid.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
6 | class RegenerateShareUUID extends Vue {
7 | @Prop()
> 8 | public absolute_url: string;
| ^
9 |
10 | @Prop()
11 | public initial_share_url: string;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
9 |
10 | @Prop()
> 11 | public initial_share_url: string;
| ^
12 |
13 | public share_url: string = '';
14 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
11 | public initial_share_url: string;
12 |
> 13 | public share_url: string = '';
| ^
14 |
15 | public handle;
16 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
27 | const el = document.getElementById('regenerate_share_uuid');
28 | if (el) {
> 29 | const initial_share_url = el.getAttribute('data-share-url');
| ^
30 | const absolute_url = el.getAttribute('data-absolute-url');
31 | new RegenerateShareUUID({propsData: {initial_share_url, absolute_url}})
32 | .$mount(el);
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
28 | if (el) {
29 | const initial_share_url = el.getAttribute('data-share-url');
> 30 | const absolute_url = el.getAttribute('data-absolute-url');
| ^
31 | new RegenerateShareUUID({propsData: {initial_share_url, absolute_url}})
32 | .$mount(el);
33 | }
/code/src/pages/codebase/release/store.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
155 | },
156 | mutations: {
> 157 | setReviewStatus(state, review_status) {
| ^
158 | state.release.review_status = review_status;
159 | },
160 | setUrls(state, urls) {
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
168 | state.files.media = files;
169 | },
> 170 | setReleaseContributors(state, release_contributors) {
| ^
171 | state.release.release_contributors = release_contributors;
172 | },
173 | setCodebaseReleaseAtPath(state, {path, value}) {
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
183 | state.files.originals[category] = value;
184 | },
> 185 | setValidationErrors(state, validation_errors) {
| ^
186 | console.log(validation_errors);
187 | validation_errors.inner.forEach((validation_error) => {
188 | _.set(state.validation_errors, validation_error.path, [validation_error.message]);
Calls to 'console.log' are not allowed. (no-console)
184 | },
185 | setValidationErrors(state, validation_errors) {
> 186 | console.log(validation_errors);
| ^
187 | validation_errors.inner.forEach((validation_error) => {
188 | _.set(state.validation_errors, validation_error.path, [validation_error.message]);
189 | });
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
185 | setValidationErrors(state, validation_errors) {
186 | console.log(validation_errors);
> 187 | validation_errors.inner.forEach((validation_error) => {
| ^
188 | _.set(state.validation_errors, validation_error.path, [validation_error.message]);
189 | });
190 | },
non-arrow functions are forbidden (only-arrow-functions)
191 | setCodebaseRelease(state, data) {
192 | Object.keys(state.release).forEach(
> 193 | function(k) {
| ^
194 | if (data[k] !== undefined) {
195 | state.release[k] = data[k];
196 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
209 | setAtPath(context, {path, value}) {
210 | context.commit('setCodebaseReleaseAtPath', {path, value});
> 211 | const schema_path = path.replace('.', '.fields.');
| ^
212 | const subSchema = _.get(schema.fields, schema_path);
213 | context.dispatch('setErrorsAtPath', {schema: subSchema, path, value});
214 | },
Shadowed name: 'schema' (no-shadowed-variable)
215 |
216 | // Calculate any validation errors after 1s wait
> 217 | setErrorsAtPath: _.debounce((context, {schema, path, value}) => schema.validate(value).then(
| ^
218 | (value) => context.commit('unsetValidationErrorAtPath', path),
219 | (validation_error) => context.commit('setValidationErrorAtPath', {
220 | path,
Shadowed name: 'value' (no-shadowed-variable)
216 | // Calculate any validation errors after 1s wait
217 | setErrorsAtPath: _.debounce((context, {schema, path, value}) => schema.validate(value).then(
> 218 | (value) => context.commit('unsetValidationErrorAtPath', path),
| ^
219 | (validation_error) => context.commit('setValidationErrorAtPath', {
220 | path,
221 | value: validation_error.errors,
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
217 | setErrorsAtPath: _.debounce((context, {schema, path, value}) => schema.validate(value).then(
218 | (value) => context.commit('unsetValidationErrorAtPath', path),
> 219 | (validation_error) => context.commit('setValidationErrorAtPath', {
| ^
220 | path,
221 | value: validation_error.errors,
222 | })), 800),
/code/src/pages/codebase/release/upload.ts
A maximum of 1 class per file is allowed. (max-classes-per-file)
44 |
45 |
> 46 | @Component({
47 | template: `<div>
48 | <p class='mt-3'>
49 | A codebase release should ideally include the source code, documentation, input data and dependencies necessary for
Exceeds maximum line length of 120 (max-line-length)
47 | template: `<div>
48 | <p class='mt-3'>
> 49 | A codebase release should ideally include the source code, documentation, input data and dependencies necessary for
50 | someone else (including your future self) to understand, replicate, or reuse the model. Please note that we impose a
51 | specific directory structure to organize your uploaded files - you can view the active filesystem layout below.
52 | Source code is placed in <code>project-root/code/</code>, data files are placed in <code>project-root/data/</code>,
Exceeds maximum line length of 120 (max-line-length)
48 | <p class='mt-3'>
49 | A codebase release should ideally include the source code, documentation, input data and dependencies necessary for
> 50 | someone else (including your future self) to understand, replicate, or reuse the model. Please note that we impose a
51 | specific directory structure to organize your uploaded files - you can view the active filesystem layout below.
52 | Source code is placed in <code>project-root/code/</code>, data files are placed in <code>project-root/data/</code>,
53 | and documentation files are placed in <code>project-root/docs/</code>, and simulation outputs are placed in
Exceeds maximum line length of 120 (max-line-length)
49 | A codebase release should ideally include the source code, documentation, input data and dependencies necessary for
50 | someone else (including your future self) to understand, replicate, or reuse the model. Please note that we impose a
> 51 | specific directory structure to organize your uploaded files - you can view the active filesystem layout below.
52 | Source code is placed in <code>project-root/code/</code>, data files are placed in <code>project-root/data/</code>,
53 | and documentation files are placed in <code>project-root/docs/</code>, and simulation outputs are placed in
54 | <code>project-root/results/</code>.
Exceeds maximum line length of 120 (max-line-length)
50 | someone else (including your future self) to understand, replicate, or reuse the model. Please note that we impose a
51 | specific directory structure to organize your uploaded files - you can view the active filesystem layout below.
> 52 | Source code is placed in <code>project-root/code/</code>, data files are placed in <code>project-root/data/</code>,
53 | and documentation files are placed in <code>project-root/docs/</code>, and simulation outputs are placed in
54 | <code>project-root/results/</code>.
55 | This means that if your source code has references to your uploaded data files you should consider using the relative path
Exceeds maximum line length of 120 (max-line-length)
51 | specific directory structure to organize your uploaded files - you can view the active filesystem layout below.
52 | Source code is placed in <code>project-root/code/</code>, data files are placed in <code>project-root/data/</code>,
> 53 | and documentation files are placed in <code>project-root/docs/</code>, and simulation outputs are placed in
54 | <code>project-root/results/</code>.
55 | This means that if your source code has references to your uploaded data files you should consider using the relative path
56 | <code>../data/<datafile></code> to access those data files. This will make the lives of others
Exceeds maximum line length of 120 (max-line-length)
53 | and documentation files are placed in <code>project-root/docs/</code>, and simulation outputs are placed in
54 | <code>project-root/results/</code>.
> 55 | This means that if your source code has references to your uploaded data files you should consider using the relative path
56 | <code>../data/<datafile></code> to access those data files. This will make the lives of others
57 | wishing to review, download and run your model easier.
58 | </p>
Exceeds maximum line length of 120 (max-line-length)
89 | acceptedFileTypes: '*/*',
90 | title: 'Upload Source Code',
> 91 | instructions: `You can upload a single plaintext source file (e.g., a NetLogo .nlogo file) or a tar or zip archive of
92 | plaintext source code representing your codebase. Archives will be unpacked and extracted as part of archival processing
93 | and system files will be removed but the archive's directory structure is preserved. All file types are currently
94 | accepted though files should be stored in open or plaintext formats. We may remove executables or binaries in the
Exceeds maximum line length of 120 (max-line-length)
90 | title: 'Upload Source Code',
91 | instructions: `You can upload a single plaintext source file (e.g., a NetLogo .nlogo file) or a tar or zip archive of
> 92 | plaintext source code representing your codebase. Archives will be unpacked and extracted as part of archival processing
93 | and system files will be removed but the archive's directory structure is preserved. All file types are currently
94 | accepted though files should be stored in open or plaintext formats. We may remove executables or binaries in the
95 | future.`,
Exceeds maximum line length of 120 (max-line-length)
91 | instructions: `You can upload a single plaintext source file (e.g., a NetLogo .nlogo file) or a tar or zip archive of
92 | plaintext source code representing your codebase. Archives will be unpacked and extracted as part of archival processing
> 93 | and system files will be removed but the archive's directory structure is preserved. All file types are currently
94 | accepted though files should be stored in open or plaintext formats. We may remove executables or binaries in the
95 | future.`,
96 | originalInstructions: 'Submitted source code file(s) to be placed in <project-root>/code/',
Exceeds maximum line length of 120 (max-line-length)
92 | plaintext source code representing your codebase. Archives will be unpacked and extracted as part of archival processing
93 | and system files will be removed but the archive's directory structure is preserved. All file types are currently
> 94 | accepted though files should be stored in open or plaintext formats. We may remove executables or binaries in the
95 | future.`,
96 | originalInstructions: 'Submitted source code file(s) to be placed in <project-root>/code/',
97 | },
Exceeds maximum line length of 120 (max-line-length)
101 | title: 'Upload Data',
102 | instructions: `Upload any datasets required by your source code. There is a limit on file upload size so if
> 103 | your datasets are very large, you may consider using osf.io or figshare or other data repository to store your
104 | data and refer to it in your code via DOI or other permanent URL. If a zip or tar archive is uploaded
105 | it will be automatically unpacked. Files should be plaintext or an open data formats but all file types
106 | are currently accepted. Please note that data files uploaded here will be placed in a "<project-root>/data"
Exceeds maximum line length of 120 (max-line-length)
106 | are currently accepted. Please note that data files uploaded here will be placed in a "<project-root>/data"
107 | directory so if you'd like for your source code to work immediately when another researcher downloads your
> 108 | codebase, please consider referring to any input data files via a relative path "../data/<your-data-file>".`,
109 | originalInstructions: 'Submitted data file(s) to be placed in <project-root>/data/',
110 | },
111 | {
Exceeds maximum line length of 120 (max-line-length)
113 | acceptedFileTypes: '*/*',
114 | title: 'Upload Narrative Documentation',
> 115 | instructions: `Upload narrative documentation that comprehensively describes your computational model. The ODD
116 | Protocol offers a good starting point for thinking about how to comprehensively describe agent based models and
117 | good Narrative Documentation often includes equations, pseudocode, and flow diagrams. Acceptable files include
118 | plain text formats (including Markdown and other structured text), OpenDocument Text files (ODT), and PDF documents.`,
Exceeds maximum line length of 120 (max-line-length)
114 | title: 'Upload Narrative Documentation',
115 | instructions: `Upload narrative documentation that comprehensively describes your computational model. The ODD
> 116 | Protocol offers a good starting point for thinking about how to comprehensively describe agent based models and
117 | good Narrative Documentation often includes equations, pseudocode, and flow diagrams. Acceptable files include
118 | plain text formats (including Markdown and other structured text), OpenDocument Text files (ODT), and PDF documents.`,
119 | originalInstructions: 'Submitted narrative documentation file(s) to be placed in <project-root>/docs/',
Exceeds maximum line length of 120 (max-line-length)
115 | instructions: `Upload narrative documentation that comprehensively describes your computational model. The ODD
116 | Protocol offers a good starting point for thinking about how to comprehensively describe agent based models and
> 117 | good Narrative Documentation often includes equations, pseudocode, and flow diagrams. Acceptable files include
118 | plain text formats (including Markdown and other structured text), OpenDocument Text files (ODT), and PDF documents.`,
119 | originalInstructions: 'Submitted narrative documentation file(s) to be placed in <project-root>/docs/',
120 | },
Exceeds maximum line length of 120 (max-line-length)
116 | Protocol offers a good starting point for thinking about how to comprehensively describe agent based models and
117 | good Narrative Documentation often includes equations, pseudocode, and flow diagrams. Acceptable files include
> 118 | plain text formats (including Markdown and other structured text), OpenDocument Text files (ODT), and PDF documents.`,
119 | originalInstructions: 'Submitted narrative documentation file(s) to be placed in <project-root>/docs/',
120 | },
121 | {
Exceeds maximum line length of 120 (max-line-length)
123 | acceptedFileTypes: '*/*',
124 | title: 'Upload Simulation Outputs',
> 125 | instructions: 'Upload simulation outputs associated with your computational model. Ideally these data files should be in plain text or other open data formats.',
126 | originalInstructions: 'Submitted model output file(s) to be placed in <project-root>/results/',
127 | },
128 | ];
Exceeds maximum line length of 120 (max-line-length)
147 | this.folderContents = response.data;
148 | } else {
> 149 | this.folderContents = { error: response.response ? `HTTP Error (${response.response.status})` : 'Unknown Error' };
150 | }
151 | }
152 |
/code/src/pages/codebase/release/workflow.ts
Exceeds maximum line length of 120 (max-line-length)
43 | <ul class="nav nav-tabs">
44 | <li class="nav-item">
> 45 | <a :class="['nav-link', tabClass('metadata')]" @click="setActive('metadata')">Metadata</a>
46 | </li>
47 | <li class="nav-item">
48 | <a :class="['nav-link', tabClass('media')]" @click="setActive('media')">Media</a>
Exceeds maximum line length of 120 (max-line-length)
57 | <div :class="['tab-pane fade', contentClass('media')]">
58 | <c-upload :uploadUrl="uploadUrl" title="Upload Media"
> 59 | instructions="Upload featured media files here. Images are displayed on the release detail page of every release"
60 | originalInstructions="Current media files" :originals="files" @doneUpload="getMediaFiles"
61 | @deleteFile="deleteFile" @clear="clear">
62 | </c-upload>
Exceeds maximum line length of 120 (max-line-length)
58 | <c-upload :uploadUrl="uploadUrl" title="Upload Media"
59 | instructions="Upload featured media files here. Images are displayed on the release detail page of every release"
> 60 | originalInstructions="Current media files" :originals="files" @doneUpload="getMediaFiles"
61 | @deleteFile="deleteFile" @clear="clear">
62 | </c-upload>
63 | </div>
== should be === (triple-equals)
89 |
90 | public isActive(name: CodebaseTabs) {
> 91 | return name == this.active;
| ^
92 | }
93 |
94 | public setActive(name: CodebaseTabs) {
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
116 | }
117 |
> 118 | public async deleteFile(image_id) {
| ^
119 | await codebaseAPI.mediaDelete(this.identifier, image_id);
120 | this.getMediaFiles();
121 | }
Exceeds maximum line length of 120 (max-line-length)
128 |
129 | export const publishSchema = yup.object().shape({
> 130 | version_number: yup.string().required().matches(/\d+\.\d+\.\d+/, 'Not a valid semantic version string. Must be in MAJOR.MINOR.PATCH format.'),
131 | });
132 |
133 | @Component({
A maximum of 1 class per file is allowed. (max-classes-per-file)
131 | });
132 |
> 133 | @Component({
134 | template: `<div class="modal fade" id="publishCodebaseReleaseModal">
135 | <div class="modal-dialog" role="document">
136 | <div class="modal-content">
Exceeds maximum line length of 120 (max-line-length)
173 | <div class="modal-footer">
174 | <button class="btn btn-secondary" @click="close">Cancel</button>
> 175 | <button class="btn btn-danger ml-auto" @click="publish"><i class='fa fa-share-alt'></i> Publish</button>
176 | </div>
177 | </div>
178 | </div>
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
188 |
189 | @Prop()
> 190 | public _version_number: number;
| ^
191 |
192 | @Prop()
193 | public absolute_url: string;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
191 |
192 | @Prop()
> 193 | public absolute_url: string;
| ^
194 |
195 | @Watch('_version_number', {immediate: true})
196 | public setVersionNumber() {
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
207 | }
208 |
> 209 | public detailPageUrl(version_number) {
| ^
210 | return codebaseReleaseAPI.detailUrl({identifier: this.identifier, version_number});
211 | }
212 |
A maximum of 1 class per file is allowed. (max-classes-per-file)
218 | }
219 |
> 220 | @Component({
221 | store: new Vuex.Store(store),
222 | components: {
223 | 'c-confirmation-modal': ConfirmationModal,
Exceeds maximum line length of 120 (max-line-length)
229 | <div v-if="isInitialized">
230 | <h1>
> 231 | <span v-if='! isPublished' title='This release is currently private and unpublished.' class="disabled btn btn-warning"><i class='fa fa-lock'></i> Private</span>
232 | {{ $store.state.release.codebase.title }} <i>v{{ $store.state.release.version_number }}</i>
233 | </h1>
234 | <h5 class="text-muted">
Exceeds maximum line length of 120 (max-line-length)
234 | <h5 class="text-muted">
235 | Peer Review Status: {{ reviewStatus }} | <a :href='absolute_url'>View Live</a>
> 236 | <a class='float-right' href='//forum.comses.net/t/archiving-your-model-1-getting-started/7377'><i class='fa fa-question-circle'></i> Need help? Check out our archiving tutorial</a>
237 | </h5>
238 | <div class='pb-2'>
239 | <span class="btn btn-primary" data-target="#editCodebaseModal" data-toggle="modal"><i class='fa fa-edit'></i> Edit Common Metadata | Add Images & Media</span>
Exceeds maximum line length of 120 (max-line-length)
237 | </h5>
238 | <div class='pb-2'>
> 239 | <span class="btn btn-primary" data-target="#editCodebaseModal" data-toggle="modal"><i class='fa fa-edit'></i> Edit Common Metadata | Add Images & Media</span>
240 | <div class='float-right'>
241 | <span class="btn btn-outline-danger" v-if="!hasReview" data-target="#peerReviewModal" data-toggle="modal">Request Peer Review</span>
242 | <span class="btn btn-outline-danger" v-else-if="isAwaitingAuthorChanges" data-target="#notifyReviewersModal" data-toggle="modal">Notify Reviewers of Changes</span>
Exceeds maximum line length of 120 (max-line-length)
239 | <span class="btn btn-primary" data-target="#editCodebaseModal" data-toggle="modal"><i class='fa fa-edit'></i> Edit Common Metadata | Add Images & Media</span>
240 | <div class='float-right'>
> 241 | <span class="btn btn-outline-danger" v-if="!hasReview" data-target="#peerReviewModal" data-toggle="modal">Request Peer Review</span>
242 | <span class="btn btn-outline-danger" v-else-if="isAwaitingAuthorChanges" data-target="#notifyReviewersModal" data-toggle="modal">Notify Reviewers of Changes</span>
243 | <span class="disabled btn btn-info" v-if="isPublished"><i class='fa fa-share-alt'></i> Published</span>
244 | <span v-else>
Exceeds maximum line length of 120 (max-line-length)
240 | <div class='float-right'>
241 | <span class="btn btn-outline-danger" v-if="!hasReview" data-target="#peerReviewModal" data-toggle="modal">Request Peer Review</span>
> 242 | <span class="btn btn-outline-danger" v-else-if="isAwaitingAuthorChanges" data-target="#notifyReviewersModal" data-toggle="modal">Notify Reviewers of Changes</span>
243 | <span class="disabled btn btn-info" v-if="isPublished"><i class='fa fa-share-alt'></i> Published</span>
244 | <span v-else>
245 | <span class="btn btn-danger" data-target="#publishCodebaseReleaseModal" data-toggle="modal"><span class='fa fa-share-alt'></span> Publish</span>
Exceeds maximum line length of 120 (max-line-length)
241 | <span class="btn btn-outline-danger" v-if="!hasReview" data-target="#peerReviewModal" data-toggle="modal">Request Peer Review</span>
242 | <span class="btn btn-outline-danger" v-else-if="isAwaitingAuthorChanges" data-target="#notifyReviewersModal" data-toggle="modal">Notify Reviewers of Changes</span>
> 243 | <span class="disabled btn btn-info" v-if="isPublished"><i class='fa fa-share-alt'></i> Published</span>
244 | <span v-else>
245 | <span class="btn btn-danger" data-target="#publishCodebaseReleaseModal" data-toggle="modal"><span class='fa fa-share-alt'></span> Publish</span>
246 | </span>
Exceeds maximum line length of 120 (max-line-length)
243 | <span class="disabled btn btn-info" v-if="isPublished"><i class='fa fa-share-alt'></i> Published</span>
244 | <span v-else>
> 245 | <span class="btn btn-danger" data-target="#publishCodebaseReleaseModal" data-toggle="modal"><span class='fa fa-share-alt'></span> Publish</span>
246 | </span>
247 | </div>
248 | </div>
Exceeds maximum line length of 120 (max-line-length)
253 | </li>
254 | <li class="nav-item">
> 255 | <router-link :to="{ name: 'contributors' }" class="nav-link" active-class="active">Contributors</router-link>
256 | </li>
257 | <li class="nav-item">
258 | <router-link :to="{ name: 'detail' }" class="nav-link" active-class="active">
Exceeds maximum line length of 120 (max-line-length)
257 | <li class="nav-item">
258 | <router-link :to="{ name: 'detail' }" class="nav-link" active-class="active">
> 259 | Metadata<span class="badge badge-pill badge-danger" v-if="detailPageErrors !== 0">{{ detailPageErrors }} errors</span>
260 | </router-link>
261 | </li>
262 | </ul>
Exceeds maximum line length of 120 (max-line-length)
264 | <router-view :initialData="initialData"></router-view>
265 | </keep-alive>
> 266 | <c-codebase-edit-form-popup :identifier="identifier" :redirect="false" :files="$store.state.files.media" @updated="setCodebase"></c-codebase-edit-form-popup>
267 | <c-publish-modal :_version_number="version_number" :identifier="identifier" :absolute_url="absolute_url"></c-publish-modal>
268 | </div>
269 | <div v-else>
Exceeds maximum line length of 120 (max-line-length)
265 | </keep-alive>
266 | <c-codebase-edit-form-popup :identifier="identifier" :redirect="false" :files="$store.state.files.media" @updated="setCodebase"></c-codebase-edit-form-popup>
> 267 | <c-publish-modal :_version_number="version_number" :identifier="identifier" :absolute_url="absolute_url"></c-publish-modal>
268 | </div>
269 | <div v-else>
270 | <h1>Loading codebase release metadata...</h1>
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
297 |
298 | @Prop()
> 299 | public version_number: string;
| ^
300 |
301 | @Prop()
302 | public review_status_enum: object;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
300 |
301 | @Prop()
> 302 | public review_status_enum: object;
| ^
303 |
304 | public isInitialized: boolean = false;
305 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
366 | }
367 |
> 368 | public setReviewStatus(review_status) {
| ^
369 | this.$store.commit('setReviewStatus', review_status);
370 | }
371 |
/code/src/pages/event/Edit.vue
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
94 | const api = new EventAPI();
95 |
> 96 | function dateAfterConstraint(before_name: string, after_name: string) {
| ^
97 | return (before_date, schema) => {
98 | if (_.isNil(before_date) || _.isNaN(before_date.getDate())) {
99 | return schema;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
94 | const api = new EventAPI();
95 |
> 96 | function dateAfterConstraint(before_name: string, after_name: string) {
| ^
97 | return (before_date, schema) => {
98 | if (_.isNil(before_date) || _.isNaN(before_date.getDate())) {
99 | return schema;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
95 |
96 | function dateAfterConstraint(before_name: string, after_name: string) {
> 97 | return (before_date, schema) => {
| ^
98 | if (_.isNil(before_date) || _.isNaN(before_date.getDate())) {
99 | return schema;
100 | } else {
Shadowed name: 'schema' (no-shadowed-variable)
95 |
96 | function dateAfterConstraint(before_name: string, after_name: string) {
> 97 | return (before_date, schema) => {
| ^
98 | if (_.isNil(before_date) || _.isNaN(before_date.getDate())) {
99 | return schema;
100 | } else {
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
141 |
142 | @Prop()
> 143 | public _id: number | null;
| ^
144 |
145 | get endDateOpenDate() {
146 | return this.state.end_date ? new Date(this.state.end_date) : new Date(this.state.start_date);
/code/src/pages/event/calendar.ts
non-arrow functions are forbidden (only-arrow-functions)
4 | const $: any = _$;
5 |
> 6 | $(function() {
| ^
7 | $('#calendar').fullCalendar({
8 | customButtons: {
9 | addEventButton: {
/code/src/pages/event/index.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
9 | }
10 |
> 11 | const _id = matchUpdateUrl(document.location.pathname);
| ^
12 | new EditEvent({ propsData: {_id}}).$mount('#app');
13 |
/code/src/pages/form.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
7 | const yupDefaultFormDispatch = {
8 | [yup.object().constructor]: (schema) => {
> 9 | const default_value: object = {};
| ^
10 | for (const field_name in schema.fields) {
11 | const subSchema = schema.fields[field_name];
12 | default_value[field_name] = createDefaultValue(subSchema);
for (... in ...) statements must be filtered with an if statement (forin)
8 | [yup.object().constructor]: (schema) => {
9 | const default_value: object = {};
> 10 | for (const field_name in schema.fields) {
| ^
11 | const subSchema = schema.fields[field_name];
12 | default_value[field_name] = createDefaultValue(subSchema);
13 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
8 | [yup.object().constructor]: (schema) => {
9 | const default_value: object = {};
> 10 | for (const field_name in schema.fields) {
| ^
11 | const subSchema = schema.fields[field_name];
12 | default_value[field_name] = createDefaultValue(subSchema);
13 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
25 | [yup.array().constructor]: (schema) => [],
26 | [yup.mixed().constructor]: (schema) => {
> 27 | const whitelist_values = schema._whitelist._map;
| ^
28 | if (!_.isEmpty(whitelist_values)) {
29 | return whitelist_values[Object.keys(whitelist_values)[0]];
30 | } else {
for (... in ...) statements must be filtered with an if statement (forin)
50 | function createFormControlConfig(schema) {
51 | const config = {};
> 52 | for (const field_name in schema.fields) {
| ^
53 | const field = schema.fields[field_name];
54 | config[field_name] = false;
55 | for (const test of field.tests) {
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
50 | function createFormControlConfig(schema) {
51 | const config = {};
> 52 | for (const field_name in schema.fields) {
| ^
53 | const field = schema.fields[field_name];
54 | config[field_name] = false;
55 | for (const test of field.tests) {
block is empty (no-empty)
68 | function createComputed(key: string, validate: (self, value) => Promise<any>) {
69 | const debouncedValidator = _.debounce((self, value) => validate(self, value)
> 70 | .catch(() => {
| ^
71 | }), 500);
72 | return {
73 | get() {
/code/src/pages/job/Edit.vue
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
71 |
72 | @Prop()
> 73 | public _id: number | null;
| ^
74 |
75 | public detailPageUrl(state) {
76 | this.state.id = state.id;
/code/src/pages/job/index.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
9 | }
10 |
> 11 | const _id = matchUpdateUrl(window.location.pathname);
| ^
12 |
13 | const job = new Edit({ propsData: { _id }}).$mount('#app');
14 |
/code/src/pages/profile/Edit.vue
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
142 | export default class EditProfile extends createFormValidator(schema) {
143 | @Prop()
> 144 | public _pk: number | null;
| ^
145 |
146 | public initial_full_member: boolean = true;
147 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
144 | public _pk: number | null;
145 |
> 146 | public initial_full_member: boolean = true;
| ^
147 |
148 | public detailPageUrl(state) {
149 | return api.detailUrl(state.user_pk);
/code/src/pages/profile/Search.vue
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
58 |
59 | @Prop()
> 60 | public is_authenticated: boolean;
| ^
61 | public fullTextSearch: string = '';
62 |
63 | public tags: Array<{ name: string }> = [];
/code/src/pages/profile/index.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
3 | function extractParams() {
4 | const el = document.getElementById('app');
> 5 | const _pk = el.getAttribute('data-user-pk');
| ^
6 | console.debug('returning ' + _pk);
7 | return {_pk};
8 | }
Calls to 'console.debug' are not allowed. (no-console)
4 | const el = document.getElementById('app');
5 | const _pk = el.getAttribute('data-user-pk');
> 6 | console.debug('returning ' + _pk);
| ^
7 | return {_pk};
8 | }
9 | new EditProfile({ propsData: extractParams()}).$mount('#app');
/code/src/pages/profile/list.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
4 | // FIXME: look into better ways to pass data from Django -> Vue. may also need to check full member status
5 | function extract_membership_status() {
> 6 | const is_authenticated_tag = document.getElementById('sidebar');
| ^
7 | const is_authenticated_value = is_authenticated_tag.getAttribute('data-is-authenticated');
8 | return is_authenticated_value === 'True';
9 | }
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
5 | function extract_membership_status() {
6 | const is_authenticated_tag = document.getElementById('sidebar');
> 7 | const is_authenticated_value = is_authenticated_tag.getAttribute('data-is-authenticated');
| ^
8 | return is_authenticated_value === 'True';
9 | }
10 | const is_authenticated = extract_membership_status();
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
8 | return is_authenticated_value === 'True';
9 | }
> 10 | const is_authenticated = extract_membership_status();
| ^
11 |
12 | new SearchProfiles({ propsData: { is_authenticated }}).$mount('#sidebar');
13 | new SortBy({
/code/src/pages/review/edit.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
29 | export class EditorReviewDetail extends Vue {
30 | @Prop()
> 31 | public status_levels: Array<{ value: string, label: string }>;
| ^
32 |
33 | public status: string = this.status_levels[0].value;
34 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
34 |
35 | @Prop()
> 36 | public review_slug: string;
| ^
37 |
38 | @Prop()
39 | public event_list_url: string;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
37 |
38 | @Prop()
> 39 | public event_list_url: string;
| ^
40 |
41 | public events: object[] = [];
42 | public event_errors: string[] = [];
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
40 |
41 | public events: object[] = [];
> 42 | public event_errors: string[] = [];
| ^
43 |
44 | public async retrieveEvents() {
45 | try {
/code/src/pages/review/event_log.ts
Exceeds maximum line length of 120 (max-line-length)
14 | <p class="card-text">
15 | <span class='badge badge-primary'>{{event.action}}</span>
> 16 | {{ event.message }} (<em>by:</em> <a :href="event.author.absolute_url">{{event.author.name}}</a>)
17 | </p>
18 | </div>
19 | </div>
/code/src/pages/review/feedback.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
25 | export class Feedback extends Vue {
26 | @Prop()
> 27 | public review_slug: string;
| ^
28 |
29 | public feedback_items: any[] = [];
30 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
27 | public review_slug: string;
28 |
> 29 | public feedback_items: any[] = [];
| ^
30 |
31 | public editorHasCompletedFeedback(feedback) {
32 | return !_.isEmpty(feedback.private_editor_notes) && !_.isEmpty(feedback.notes_to_author);
/code/src/pages/review/index.ts
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
3 | function extractParams() {
4 | const el = document.getElementById('app');
> 5 | const review_slug = el.getAttribute('data-review-slug');
| ^
6 | const status_levels = JSON.parse(el.getAttribute('data-status-levels'));
7 | const status = el.getAttribute('data-status');
8 | const event_list_url = el.getAttribute('data-event-list-url');
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
4 | const el = document.getElementById('app');
5 | const review_slug = el.getAttribute('data-review-slug');
> 6 | const status_levels = JSON.parse(el.getAttribute('data-status-levels'));
| ^
7 | const status = el.getAttribute('data-status');
8 | const event_list_url = el.getAttribute('data-event-list-url');
9 | return {props: {review_slug, status_levels, event_list_url}, data: {status}};
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
6 | const status_levels = JSON.parse(el.getAttribute('data-status-levels'));
7 | const status = el.getAttribute('data-status');
> 8 | const event_list_url = el.getAttribute('data-event-list-url');
| ^
9 | return {props: {review_slug, status_levels, event_list_url}, data: {status}};
10 | }
11 |
/code/src/pages/review/invitations.ts
Exceeds maximum line length of 120 (max-line-length)
14 | <h2>Invite a Reviewer</h2>
15 | <p class="text-muted">
> 16 | Search by name, email address, or username among existing CoMSES Net members (<em>external reviewer invitation not implemented yet</em>)
17 | </p>
18 | <div class="container-fluid" v-if="!candidate_reviewer">
19 | <div class="row">
Exceeds maximum line length of 120 (max-line-length)
33 | <span class="pull-right">
34 | <button class="btn btn-primary" @click="sendEmail" type="button">Invite</button>
> 35 | <button class="btn btn-danger" @click="candidate_reviewer = null" type="button">Cancel</button>
36 | </span>
37 | </h2>
38 | <div class="tag-list">
Exceeds maximum line length of 120 (max-line-length)
46 | <div class="row border-bottom py-2" v-for="invitation in invitations">
47 | <div class="col-xs-12 col-sm-2">
> 48 | <img :src="invitation.candidate_reviewer.avatar_url" v-if="invitation.candidate_reviewer" class='img-fluid img-thumbnail'>
49 | <span v-else>No image</span>
50 | </div>
51 | <div class="col-xs-12 col-sm-10">
Exceeds maximum line length of 120 (max-line-length)
54 | <span class="badge badge-info">{{ displayInvitationStatus(invitation) }}</span>
55 | <span class="float-md-right">
> 56 | <button class="btn btn-outline-secondary" @click="resendEmail(invitation.slug)">Resend Invite</button>
57 | </span>
58 | </h3>
59 | <div class="tag-list">
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
73 | })
74 | export class Invitations extends Vue {
> 75 | public candidate_reviewer = null;
| ^
76 | public candidate_email = '';
77 | public invitations: any[] = [];
78 | public feedback: any[] = [];
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
74 | export class Invitations extends Vue {
75 | public candidate_reviewer = null;
> 76 | public candidate_email = '';
| ^
77 | public invitations: any[] = [];
78 | public feedback: any[] = [];
79 |
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
79 |
80 | @Prop()
> 81 | public review_slug: string;
| ^
82 |
83 | get state() {
84 | return this.invitations;
variable name must be in lowerCamelCase, PascalCase or UPPER_CASE (variable-name)
130 | }
131 |
> 132 | public async resendEmail(invitation_slug) {
| ^
133 | const response = await reviewApi.resendInvitation({slug: this.review_slug, invitation_slug});
134 | this.$emit('pollEvents');
135 | }
/code/src/pages/review/reviewer_finder.ts
Exceeds maximum line length of 120 (max-line-length)
40 | <div class="row">
41 | <div class="col-2">
> 42 | <img :src="props.option.avatar_url" class='img-fluid img-thumbnail' alt='No picture available'>
43 | </div>
44 | <div class="col-10">
45 | <h2>{{ props.option.name }}</h2>
/code/src/store/common.ts
An interface declaring no members is equivalent to its supertype. (no-empty-interface)
135 | }
136 |
> 137 | export interface CodebaseEdit extends AbstractCodebase {
| ^
138 | }
139 |
140 | export interface Dependency {
Exceeds maximum line length of 120 (max-line-length)
146 | }
147 |
> 148 | // codebase_contributors, dependencies, description, documentation, doi, download_count, enbargo_end_date, license, os, peer_reviewed, platforms, programming_languages, submitted_package, submitter, version_number
149 | interface AbstractCodebaseRelease extends UndefinedWithId {
150 | absolute_url: string;
151 | release_contributors: CodebaseContributor[];
/code/src/vendors.ts
Exceeds maximum line length of 120 (max-line-length)
1 | import Popper from 'popper.js';
> 2 | // This window hack is temporary https://stackoverflow.com/questions/45645971/bootstrap-4-beta-importing-popper-js-with-webpack-3-x-throws-popper-is-not-a-con
3 | (window as any).Popper = Popper;
4 | import 'bootstrap';
5 | import 'lodash';
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
There's some variable definition consistency issues (use camelCase), variable scope shadowing issues, and other minor hygiene like line length and using
!==
instead of!=