Showing 1,820 of 4,015 total issues
Function ZapierModal
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ZapierModal = NiceModal.create(() => {
const modal = NiceModal.useModal();
const {updateRoute} = useRouting();
const {zapierTemplates} = useSettingsApp();
const {data: {integrations} = {integrations: []}} = useBrowseIntegrations();
Function AnnouncementBarModal
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AnnouncementBarModal: React.FC = () => {
const {siteData} = useGlobalData();
const {localSettings, updateSetting, handleSave, okProps} = useSettingGroup({savingDelay: 500});
const [announcementContent] = getSettingValues<string>(localSettings, ['announcement_content']);
const [accentColor] = getSettingValues<string>(localSettings, ['accent_color']);
Function Content
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const Content = () => {
const labs = useLabs();
const {t} = useAppContext();
const {pagination, member, comments, commentCount, commentsEnabled, title, showCount, secundaryFormCount} = useAppContext();
- 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 PreviewModalContent
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const PreviewModalContent: React.FC<PreviewModalProps> = ({
testId,
title,
titleHeadingLevel = 4,
size = 'full',
- 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 chartOptions
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
get chartOptions() {
const barColor = this.feature.nightShift ? 'rgba(200, 204, 217, 0.25)' : 'rgba(200, 204, 217, 0.65)';
return {
responsive: true,
Function init
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
if (this.service) {
return;
}
App
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
export default class App extends React.Component {
constructor(props) {
super(props);
this.setupCustomTriggerButton(props);
ActivityPubAPI
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
export class ActivityPubAPI {
constructor(
private readonly apiUrl: URL,
private readonly authApiUrl: URL,
private readonly handle: string,
File dashboard-mocks.js
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Service from '@ember/service';
import {tracked} from '@glimmer/tracking';
/**
* @typedef {import('./dashboard-stats').MemberCountStat} MemberCountStat
Function exports
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Bookshelf) {
Bookshelf.Model = Bookshelf.Model.extend({
// Ghost option handling - get permitted attributes from server/data/schema.js, where the DB schema is defined
permittedAttributes: function permittedAttributes() {
return _.keys(schema.tables[this.tableName])
Function ping
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ping(post) {
let message;
let title;
let author;
let description;
Function AccountEmailPage
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AccountEmailPage() {
const {member, onAction, site, t, pageData} = useContext(AppContext);
let newsletterUuid;
let action;
if (pageData) {
Function AddNewsletterModal
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
const modal = useModal();
const {updateRoute} = useRouting();
const handleError = useHandleError();
Function pipeline
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const pipeline = (apiController, apiUtils, apiType) => {
if (controllerMap.has(apiController)) {
return controllerMap.get(apiController);
}
- 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 body_class
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function body_class(options) { // eslint-disable-line camelcase
let classes = [];
const context = options.data.root.context || [];
const obj = this.post || this.page;
const tags = obj && obj.tags ? obj.tags : [];
- 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 InviteUserModal
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const InviteUserModal = NiceModal.create(() => {
const modal = NiceModal.useModal();
const rolesQuery = useBrowseRoles();
const assignableRolesQuery = useBrowseRoles({
searchParams: {limit: 'all', permissions: 'assign'}
- 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 getLinkTarget
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const getLinkTarget = (action: Action): InternalLink | ExternalLink | undefined => {
let resourceType = action.resource_type;
if (action.event !== 'deleted') {
switch (action.resource_type) {
- 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 sendMagicLink
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
async sendMagicLink(req, res) {
const {email, honeypot, autoRedirect} = req.body;
let {emailType, redirect} = req.body;
let referer = req.get('referer');
Function handleImageSizes
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function handleImageSizes(req, res, next) {
// In admin we need to read images and calculate the average color (blocked by CORS otherwise)
res.setHeader('Access-Control-Allow-Origin', '*');
if (!SIZE_PATH_REGEX.test(req.url)) {
Function EmbedSignupFormModal
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmbedSignupFormModal = NiceModal.create(() => {
let i18nEnabled = false;
const [selectedColor, setSelectedColor] = useState<string>('#08090c');
const [selectedLabels, setSelectedLabels] = useState<SelectedLabelTypes[]>([]);