Showing 1,820 of 4,015 total issues
Function authMemberByUuid
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const authMemberByUuid = async function authMemberByUuid(req, res, next) {
try {
const uuid = req.query.uuid;
if (!uuid) {
if (res.locals.member && req.member) {
Function notifiyReport
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async notifiyReport(comment, reporter) {
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')});
const owner = await this.models.User.getOwnerUser();
Function up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
const cancelledSubscriptions = await knex
.select(
'members.id as member_id',
'members_stripe_customers_subscriptions.id',
Function up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
const products = await knex
.select('id')
.from('products');
Function up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Populating built-in collections');
const existingLatestCollection = await knex('collections')
.where({
Function formatPageResponse
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function formatPageResponse(result, pageAsPost = false, locals = {}) {
const response = {};
if (result.posts) {
response.posts = result.posts;
Function getPreviewData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getPreviewData(previewHeader, customThemeSettingKeys = []) {
// Keep the string shorter with short codes for certain parameters
const supportedSettings = {
c: 'accent_color',
icon: 'icon',
Function FeedbackPage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function FeedbackPage() {
const {site, pageData, member, t, api} = useContext(AppContext);
const {uuid, key, postId, score: initialScore} = pageData;
const [score, setScore] = useState(initialScore);
const positive = score === 1;
Function renderSubmitButton
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSubmitButton() {
const {action, site, brandColor, pageQuery, t} = this.context;
if (isInviteOnlySite({site, pageQuery})) {
return null;
Function setup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setup = (overrides) => {
const {mockOnActionFn, ...utils} = render(
<SignupPage />,
{
overrideContext: {
Function canActivate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async canActivate(context: ExecutionContext): Promise<boolean> {
const request = context.switchToHttp().getRequest<Request>();
const response = context.switchToHttp().getResponse<Response>();
const user = await this.sessionService.getUserForSession(request, response);
Function ViewFollowersModal
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ViewFollowersModal: React.FC<RoutingModalProps> = ({}) => {
const {updateRoute} = useRouting();
const {data: followers = [], isLoading} = useFollowersForUser('index');
Function useOptions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useOptions(scriptTag: HTMLElement) {
const buildOptions = React.useCallback(() => {
/**
* @type {HTMLElement}
*/
Consider simplifying this complex logical expression. Open
Open
if (pathName && modalPaths && loadModals) {
const [, currentModalName] = Object.entries(modalPaths).find(([modalPath]) => matchRoute(currentRoute || '', modalPath)) || [];
const [path, modalName] = Object.entries(modalPaths).find(([modalPath]) => matchRoute(pathName, modalPath)) || [];
return {
Function setTwitterUrl
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@action
setTwitterUrl(event) {
const {model, modelProperty} = this.args;
const newUrl = event.target.value;
Function beforeSend
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function beforeSend(event, hint) {
try {
const exception = hint.originalException;
event.tags = event.tags || {};
event.tags.shown_to_user = event.tags.shown_to_user || false;
Function minimumAmountForCurrency
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function minimumAmountForCurrency(currency) {
const isoCurrency = currency?.toUpperCase();
switch (isoCurrency) {
case 'AED':
Function updateCheckResponse
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async updateCheckResponse(response) {
let notifications = [];
let notificationGroups = (this.config.notificationGroups || []).concat(['all']);
debug('Notification Groups', notificationGroups);
Function cancelSubscription
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async cancelSubscription(data, options) {
const sharedOptions = {
transacting: options ? options.transacting : null
};
if (!this._stripeAPIService.configured) {
Function getCustomerIdByEmail
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getCustomerIdByEmail(email) {
await this._searchRateLimitBucket.throttle();
try {
const result = await this._stripe.customers.search({
query: `email:"${email}"`,