Showing 1,820 of 4,015 total issues
Function setupWebhook
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async setupWebhook(id, secret, opts = {}) {
if (!id || !secret || opts.forceCreate) {
if (id && !opts.skipDelete) {
try {
await this.api.deleteWebhookEndpoint(id);
Function destroy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async destroy(data, options) {
const member = await this._Member.findOne(data, options);
if (!member) {
// throw error?
Function check
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
check: function check(object) {
const self = this;
return this.getByEmail(object.email)
.then((user) => {
Function onSaving
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onSaving: function onSaving(model, attr, options) {
let labelsToSave = [];
if (_.isUndefined(this.get('labels'))) {
this.unset('labels');
Function getPostServiceInstance
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getPostServiceInstance = () => {
const urlUtils = require('../../../shared/url-utils');
const labs = require('../../../shared/labs');
const models = require('../../models');
const PostStats = require('./stats/PostStats');
Function notifyPostAuthors
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async notifyPostAuthors(comment) {
const post = await this.models.Post.findOne({id: comment.get('post_id')}, {withRelated: ['authors']});
const member = await this.models.Member.findOne({id: comment.get('member_id')});
for (const author of post.related('authors')) {
Function commentOnPost
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async commentOnPost(post, member, comment, options) {
this.checkEnabled();
const memberModel = await this.models.Member.findOne({
id: member
}, {
Function doImport
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async doImport(options, importOptions) {
debug('doImport', this.modelName, this.dataToImport.length);
let ops = [];
Function renderCounts
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderCounts = function () {
for (const [id, count] of Object.entries(countsMap)) {
const countElems = document.querySelectorAll(`[data-ghost-comment-count="${id}"]`);
countElems.forEach((e) => {
let text = e.dataset.ghostCommentCountEmpty;
Function previewController
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function previewController(req, res, next) {
debug('previewController');
const api = require('../../proxy').api;
Function entryLookup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function entryLookup(postUrl, routerOptions, locals) {
debug(postUrl);
const api = require('../proxy').api;
const targetPath = url.parse(postUrl).path;
Function fetchPageHtml
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async fetchPageHtml(url, options = {}) {
// Fetch url and get response as binary buffer to
// avoid implicit cast
let {headers, body, url: responseUrl} = await this.fetchPage(
url,
Function renderSignupTerms
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSignupTerms() {
const {site} = this.context;
if (site.portal_signup_terms_html === null || site.portal_signup_terms_html === '') {
return null;
Function renderSignupTerms
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSignupTerms() {
const {site} = this.context;
if (site.portal_signup_terms_html === null || site.portal_signup_terms_html === '') {
return null;
}
Function create
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async create(data: any): Promise<Collection> {
let id;
if (!data.id) {
id = new ObjectID();
Function injectContentIntoIframe
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const injectContentIntoIframe = useCallback((iframe: HTMLIFrameElement) => {
if (!url) {
return;
}
Function minimumAmountForCurrency
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function minimumAmountForCurrency(currency: string) {
const isoCurrency = currency?.toUpperCase();
switch (isoCurrency) {
case 'AED':
Function useOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useOptions(scriptTag: HTMLElement) {
const buildOptions = React.useCallback(() => {
const labels = [];
while (scriptTag.dataset[`label-${labels.length + 1}`]) {
Function handleResponse
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleResponse = async (response: Response) => {
if (response.status === 0) {
throw new ServerUnreachableError();
} else if (response.status === 503) {
throw new MaintenanceError(response, await response.text());
Function generate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generate() {
const count = this.count;
this.count = this.count + 1;
const relatedProduct = this.products.find(product => product.id === this.model.product_id);