Showing 1,820 of 4,015 total issues
Function doImport
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async doImport(options, importOptions) {
debug('doImport', this.modelName, this.dataToImport.length);
let ops = [];
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = createIrreversibleMigration(async (knex) => {
logging.info('Updating unsplash setting value');
const unsplashSetting = await knex('settings')
.select('value')
Function down
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function down(knex) {
const freeTier = await knex('products').select('id').where('type', 'free').first();
const portalPlanSetting = await knex('settings').select('value').where('key', 'portal_plans').first();
if (!freeTier) {
Function down
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function down(knex) {
// eslint-disable-next-line no-restricted-syntax
const compedMemberIds = (await knex('members')
.select('members.id')
.innerJoin(
Function up
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
// eslint-disable-next-line no-restricted-syntax
const compedMemberIds = (await knex('members')
.select('members.id')
.innerJoin(
Function singleUploadFunction
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const single = name => function singleUploadFunction(req, res, next) {
const singleUpload = upload.single(name);
singleUpload(req, res, (err) => {
if (err) {
Function pagination
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function pagination(options) {
options = options || {};
options.hash = options.hash || {};
options.data = options.data || {};
Function updateLocalTemplateOptions
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateLocalTemplateOptions(req, res, next) {
const localTemplateOptions = hbs.getLocalTemplateOptions(res.locals);
// adjust @site.url for http/https based on the incoming request
const siteData = {
Function getOgImage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getOgImage(data) {
const context = data.context ? data.context : null;
const contextObject = getContextObject(data, context);
if (_.includes(context, 'home')) {
Function match
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function match(...attrs) {
// options = options || {};
// options.hash = options.hash || {};
// options.data = options.data || {};
Function getTwitterImage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getTwitterImage(data) {
const context = data.context ? data.context : null;
const contextObject = getContextObject(data, context);
if (_.includes(context, 'home')) {
Function then
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.then(function then(lookup) {
// Format data 1
const entry = lookup ? lookup.entry : false;
if (!entry) {
Function SearchResultBox
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SearchResultBox() {
const {searchValue = '', searchIndex, indexComplete} = useContext(AppContext);
let searchResults = null;
let filteredTags = [];
let filteredPosts = [];
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(options) {
options = options || {};
options.maxPerPage = options.maxPerPage || 50000;
Function EmailSuppressedPage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function EmailSuppressedPage() {
const {brandColor, onAction, site, t, pageData} = useContext(AppContext);
const supportAddress = `mailto:${getSupportAddress({site})}`;
const directAccess = (pageData && pageData.direct) || false;
Function renderForm
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderForm() {
const {site, t} = this.context;
if (!isSigninAllowed({site})) {
return (
Function handleOfferQuery
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async handleOfferQuery({site, offerId, member = this.state.member}) {
const {portal_button: portalButton} = site;
removePortalLinkFromUrl();
if (!isPaidMember({member})) {
try {
Function renderSubmitButton
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSubmitButton() {
const {action, brandColor, t} = this.context;
const {pageData: offer} = this.context;
let label = t('Continue');
Function ImportModalContent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ImportModalContent = () => {
const modal = useModal();
const {mutateAsync: importContent} = useImportContent();
const [uploading, setUploading] = useState(false);
const handleError = useHandleError();
Function ViewFollowingModal
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ViewFollowingModal: React.FC<RoutingModalProps> = ({}) => {
const {updateRoute} = useRouting();
const {data: following = []} = useFollowingForUser('index');