a11smiles / GitSync

Class methods should utilize this JS-0105
Anti-pattern
Minor
3 months ago2 years old
Expected 'this' to be used by class method 'updateIssue'
654        workItems.forEach(async (workItem) => { await this.updateIssue(config, client, workItem); });
655    }
656
657    updateIssue(config, client, workItem) {658        log.info(`Updating issue for work item (${workItem.id})...`);
659        const octokit = new github.getOctokit(config.github.token);
660        const owner = config.GITHUB_REPOSITORY_OWNER;
Expected 'this' to be used by class method 'getAssignee'
105        return labels;
106    }
107
108    getAssignee(config, useDefault) {109        let assignee = null;
110
111        if (!!config.assignee && !!config.ado.mappings && !!config.ado.mappings.handles) {
Expected 'this' to be used by class method 'createLabels'
 91        return url.replace("api.github.com/repos/", "github.com/");
 92    }
 93
 94    createLabels(seed, labelsObj) { 95        let labels = seed;
 96
 97        log.debug("Labels:", labelsObj);
Expected 'this' to be used by class method 'cleanUrl'
 87        return new azdo.WebApi(config.ado.orgUrl, azdo.getPersonalAccessTokenHandler(config.ado.token));
 88    }
 89
 90    cleanUrl(url) { 91        return url.replace("api.github.com/repos/", "github.com/");
 92    }
 93
Expected 'this' to be used by class method 'getConnection'
 83        return config;
 84    }
 85
 86    getConnection(config) { 87        return new azdo.WebApi(config.ado.orgUrl, azdo.getPersonalAccessTokenHandler(config.ado.token));
 88    }
 89