Showing 1,820 of 4,015 total issues
Function browse
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
browse({page, postId, order}: {page: number, postId: string, order?: string}) {
let filter = null;
if (firstCommentCreatedAt && !order) {
filter = `created_at:<=${firstCommentCreatedAt}`;
}
Function renderExampleProfiles
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderExampleProfiles = () => {
const renderEl = (profile: {name: string, avatar: string, expertise: string}) => {
return (
<Transition
key={profile.name}
Function getActivities
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getActivities(
includeOwn: boolean = false,
includeReplies: boolean = false,
excludeNonFollowers: boolean = false,
filter: {type?: string[]} | null = null,
Function adminXPlaywrightConfig
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function adminXPlaywrightConfig(overrides: Partial<PlaywrightTestConfig> = {}) {
/**
* See https://playwright.dev/docs/test-configuration.
*/
return defineConfig({
Function generate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generate() {
const errors = [
{
severity: 'permanent',
code: 605,
Function humanizeRecipientFilter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default helper(function humanizeRecipientFilter([filter = '']/*, hash*/) {
const parts = filter.split(',');
if (parts.includes('status:free') && parts.includes('status:-free')) {
return 'All subscribers';
Function generate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generate() {
const id = this.fastFakeObjectId();
// Use name from American locale to reflect an English-speaking audience
const name = `${americanFaker.name.firstName()} ${americanFaker.name.lastName()}`;
const timestamp = this.timestamps.pop();
Function input
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.input = (apiConfig, apiSerializers, frame) => {
debug('input');
const tasks = [];
const sharedSerializers = require('./input');
Function input
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.input = (apiConfig, apiValidators, frame) => {
debug('input begin');
const tasks = [];
const sharedValidators = require('./input');
Function add
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add(apiConfig, frame) {
debug('validate add');
// NOTE: this block should be removed completely once JSON Schema validations
// are introduced for all of the endpoints
Function get
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async get(result, apiConfigHeaders = {}, frame) {
let headers = {};
if (apiConfigHeaders.disposition) {
const dispositionHeader = await disposition[apiConfigHeaders.disposition.type](result, apiConfigHeaders.disposition);
Function notifyParentCommentAuthor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async notifyParentCommentAuthor(reply) {
const parent = await this.models.Comment.findOne({id: reply.get('parent_id')});
const parentMember = parent.related('member');
if (parent?.get('status') !== 'published' || !parentMember.get('enable_comment_notifications')) {
Function mediaUploadFunction
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const media = (fileName, thumbName) => function mediaUploadFunction(req, res, next) {
const mediaUpload = upload.fields([{
name: fileName,
maxCount: 1
}, {
Function collection
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async function collection(slug, options) {
options = options || {};
options.hash = options.hash || {};
options.data = options.data || {};
Function makeReady
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async makeReady() {
try {
let state = await this.getState();
printState({state});
Function makeAPICall
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function makeAPICall(resource, controllerName, action, apiOptions) {
const controller = api[controllerName];
let makeRequest = options => controller[action](options);
const {
Function setResponseContext
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setResponseContext(req, res, data) {
const pageParam = req.params && req.params.page !== undefined ? parseInt(req.params.page, 10) : 1;
res.locals = res.locals || {};
res.locals.context = [];
Function nullable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get nullable(): UnsafeData|NullData {
if (this.data === null) {
const d: NullData = {
get string() {
return null;
Function setupFirstPromoter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setupFirstPromoter({site, member}) {
if (hasMode(['test'])) {
return null;
}
const firstPromoterId = getFirstpromoterId({site});
Function SupportSuccess
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SupportSuccess = () => {
const {onAction, brandColor, site, t} = useContext(AppContext);
const successTitle = t('Thank you for your support');
const successDescription = t('To continue to stay up to date, subscribe to {{publication}} below.', {publication: site?.title});
const buttonLabel = t('Sign up');