Showing 1,756 of 3,886 total issues
Function edit
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
edit(apiConfig, frame) {
const errors = [];
_.each(frame.data.settings, (setting) => {
// TODO: the below array is INCOMPLETE
Function testRoutes
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function testRoutes() {
const router = express.Router('testmode');
router.get('/500', (req, res) => res.sendStatus(500));
router.get('/400', (req, res) => res.sendStatus(400));
Function validateCollections
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
_private.validateCollections = function validateCollections(collections) {
if (collections.constructor !== Object) {
throw new errors.ValidationError({
message: tpl(messages.validationError, {
at: collections,
Function SlackModal
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SlackModal = NiceModal.create(() => {
const {updateRoute} = useRouting();
const modal = NiceModal.useModal();
const {localSettings, updateSetting, handleSave, validate, errors, clearError} = useSettingGroup({
Function add
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
add({api, InviteModel, invites, options, user}) {
let invite;
let emailData;
return InviteModel.findOne({email: invites[0].email}, options)
Function init
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
async init() {
if (this.didInit) {
return;
}
this.didInit = true;
Function initServices
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function initServices() {
debug('Begin: initServices');
debug('Begin: Services');
const stripe = require('./server/services/stripe');
Function BuiltInIntegrations
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BuiltInIntegrations: React.FC = () => {
const {config} = useGlobalData();
const {updateRoute} = useRouting();
const openModal = (modal: string) => {
Function create
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
static async create(data, uniqueChecker) {
let isNew = false;
let id;
if (data.id instanceof ObjectID) {
- 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 error
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
error(error, transition) {
// unauthoirized errors are already handled in the ajax service
if (isUnauthorizedError(error)) {
return false;
}
- 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 beforeSend
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const beforeSend = function (event, hint) {
try {
const exception = hint.originalException;
const code = exception?.code ?? null;
const context = exception?.context ?? null;
- 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 setupFirstPromoter
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
setupFirstPromoter({site, member}) {
if (hasMode(['test'])) {
return null;
}
const firstPromoterId = getFirstpromoterId({site});
- 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 getPageFromLinkPath
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
getPageFromLinkPath(path, useSite) {
const customPricesSignupRegex = /^signup\/?(?:\/(\w+?))?\/?$/;
const customMonthlyProductSignup = /^signup\/?(?:\/(\w+?))\/monthly\/?$/;
const customYearlyProductSignup = /^signup\/?(?:\/(\w+?))\/yearly\/?$/;
const customOfferRegex = /^offers\/(\w+?)\/?$/;
- 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 TierDetailPreview
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const TierDetailPreview: React.FC<TierDetailPreviewProps> = ({tier, isFreeTier}) => {
const [showingYearly, setShowingYearly] = useState(false);
const name = tier?.name || '';
const description = tier?.description || '';
- 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 Avatar
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const Avatar: React.FC<AvatarProps> = ({comment}) => {
const {member, avatarSaturation, t} = useAppContext();
const dimensionClasses = getDimensionClasses();
const memberName = member?.name ?? comment?.member?.name;
- 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 useForm
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const useForm = <State>({initialState, savingDelay, savedDelay = 2000, onSave, onSaveError, onSavedStateReset: onSaveCompleted, onValidate}: {
initialState: State;
savingDelay?: number;
savedDelay?: number;
onSave: (state: State) => void | Promise<void>;
- 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 pipeline
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const pipeline = (apiController, apiUtils, apiType) => {
if (controllerMap.has(apiController)) {
return controllerMap.get(apiController);
}
Function edit
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
edit: function edit(data, unfilteredOptions) {
const options = this.filterOptions(unfilteredOptions, 'edit');
const self = this;
const ops = [];
Function exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = createIrreversibleMigration(async (knex) => {
logging.info('Populating slack_url and slack_username setting values');
const slackURLSetting = await knex('settings')
.select('value')
Function filterRelations
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
filterRelations() {
return {
labels: {
tableName: 'labels',
type: 'manyToMany',