Showing 3,654 of 3,654 total issues
Function getMimetypeHumanReadable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getMimetypeHumanReadable(mimetype?: string): string {
const {gettext} = superdeskApi.localization;
if (mimetype == null || mimetype.length === 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 startApp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function startApp(
extensions: Array<IExtensionLoader>,
customUiComponents: IConfigurableUiComponents,
customAlgorithms: IConfigurableAlgorithms = {},
) {
- 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 04001
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
'04001': (_error) => {
for (let error of Object.keys(_error.errors!)) {
for (let key of _error.errors![error]) {
if (key === 'unique') {
return superdeskApi.localization.gettext('Error[{{number}}]: {{error}} not unique', {
- 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 makeConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function makeConfig(grunt) {
var appConfigPath = path.join(process.cwd(), 'superdesk.config.js');
if (process.env.SUPERDESK_CONFIG) {
appConfigPath = path.join(process.cwd(), process.env.SUPERDESK_CONFIG);
- 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 AdminPublishSettingsService
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function AdminPublishSettingsService(api) {
var _fetch = function(endpoint, criteria) {
return api[endpoint].query(criteria);
};
- 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 canPublish
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function canPublish(item: IArticle): boolean {
if (
sdApi.user.hasPrivilege('publish') !== true
|| item.flags?.marked_for_not_publication === true
|| item.state === 'draft'
- 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 ContentProfilesController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function ContentProfilesController($scope: IScope, $location, notify, content, modal, $q) {
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {gettext} = this.props.superdesk.localization;
const {getClass} = this.props.superdesk.utilities.CSS;
const degree = this.state.transformations.degree + 'deg';
const videoRef = this.videoRef.current;
- 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 WorkspaceService
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function WorkspaceService(api, desks, session, preferences, $q, modal) {
Function getEntity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getEntity: (id) => {
return authoringStorageIArticle.getEntity(id).then(({saved, autosaved}) => {
const newItem = {...saved};
newItem.flags.marked_for_sms = 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 componentDidUpdate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(_prevProps, prevState: IState<T>) {
const {authoringStorage} = this.props;
const state = this.state;
if (
- 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 handleKeyUp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
handleKeyUp(event: KeyboardEvent) {
const matchingKeyBinding: string | null = Object.keys(this.props.keyBindings).find((hotkey) => {
const split = hotkey.split('+');
const altRequired = split.includes('alt');
const shiftRequired = split.includes('shift');
- 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 save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
save(state: IStateLoaded<T>): Promise<T> {
const {authoringStorage} = this.props;
if ((this.props.validateBeforeSaving ?? true) === true) {
const {profile} = state;
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {value1, value2, config} = this.props;
const values1 = (() => {
if (value1 == 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 getFieldsData
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
item: T,
fields: Map<string, IAuthoringFieldV2>,
fieldsAdapter: IFieldsAdapter<T>,
authoringStorage: IAuthoringStorage<T>,
storageAdapter: IStorageAdapter<T>,
Function runTansa
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function runTansa(contentProfile: IContentProfileV2, fieldsData: Map<string, unknown>) {
// Disable tansa for all text fields.
Array.from(document.querySelectorAll(
'input[type="text"], textarea, [contenteditable]',
)).forEach((el) => {
- 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 AggregateSettings
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function AggregateSettings(desks, workspaces, session, preferencesService, WizardHandler, $filter) {
Function getInlineToolbarActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getInlineToolbarActions(
{
item,
hasUnsavedChanges,
save,
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {attachment, differenceType} = this.props;
const change = ((): IChange | null => {
if (differenceType === 'added') {
- 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 getFieldContainer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
useHeaderLayout: boolean,
canBeToggled: boolean,
field: IAuthoringFieldV2,
toggledOn: boolean,
toggleField: (fieldId: string) => void,