Showing 1,820 of 4,015 total issues
Function reassignPost
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reassignPost = (async () => {
let trx = options.transacting;
let knex = ghostBookshelf.knex;
try {
Function query
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
query(frame) {
return Promise.resolve()
.then(() => {
return auth.setup.assertSetupCompleted(false)();
})
Function replyToComment
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
async replyToComment(parent, member, comment, options) {
this.checkEnabled();
const memberModel = await this.models.Member.findOne({
id: member
}, {
Function parseRedirectsFile
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const parseRedirectsFile = (content, ext) => {
if (ext === '.json') {
let redirects;
try {
Function notImplemented
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const notImplemented = function notImplemented(req, res, next) {
// CASE: user is logged in, allow
if (!req.api_key) {
return next();
}
Function getImageSizeFromStoragePath
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
getImageSizeFromStoragePath(imagePath) {
let filePath;
imagePath = this.urlUtils.urlFor('image', {image: imagePath}, true);
Function exports
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = createIrreversibleMigration(async (knex) => {
logging.info(`Starting regeneration of posts HTML`);
await knex.transaction(async (trx) => {
// get list of posts ids, use .forUpdate to lock rows until the transaction is finished
Function handle
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
async handle(argv = {}) {
// If we can't stream, throw an error while creating the connection
process.env.REQUIRE_INFILE_STREAM = '1';
const knex = require('../server/data/db/connection');
Function intercept
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
intercept<T>(context: ExecutionContext, next: CallHandler): Observable<T> {
if (context.getType() !== 'http') {
return next.handle();
}
const [
Function renderOfferMessage
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderOfferMessage({offer, product, t}) {
const offerMessages = {
forever: t(`{{amount}} off forever.`, {
amount: this.getOffAmount({offer})
}),
Function getInputFields
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
getInputFields({state, fieldNames}) {
const {site: {portal_name: portalName}, t} = this.context;
const errors = state.errors || {};
const fields = [
Function UniversalImportModal
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UniversalImportModal: React.FC = () => {
const modal = useModal();
const {mutateAsync: importContent} = useImportContent();
const [uploading, setUploading] = useState(false);
const handleError = useHandleError();
Function onThemeUpload
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onThemeUpload = async (file: File) => {
const themeFileName = file?.name.replace(/\.zip$/, '');
const existingThemeNames = themes.map(t => t.name);
if (isDefaultOrLegacyTheme({name: themeFileName})) {
NiceModal.show(ConfirmationModal, {
Function import
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
async import(quantity) {
if (quantity === 0) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function identifyUser
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export async function identifyUser(user) {
// Return early if window.posthog doesn't exist
if (!isPosthogLoaded()) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onExcerptKeydown
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
@action
onExcerptKeydown(event) {
// move cursor to the title on
// - Shift+Tab (handled by the browser)
// - Arrow Up/Left when input is empty or caret at start of input
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getMRR
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getMRR({interval, amount, status = null, canceled = false, discount = null}) {
if (status === 'trialing') {
return 0;
}
if (status === 'incomplete') {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function prepareError
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports.prepareError = function prepareError(err, req, res, next) {
debug(err);
if (Array.isArray(err)) {
err = err[0];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _getSubscriptionCheckoutData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
async _getSubscriptionCheckoutData(body) {
const tierId = body.tierId;
const offerId = body.offerId;
let cadence = body.cadence;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function serializeMember
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function serializeMember(member, options) {
const json = member.toJSON ? member.toJSON(options) : member;
const comped = json.status === 'comped';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"