Showing 3,654 of 3,654 total issues
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {gettext} = superdeskApi.localization;
const allowedStates = this.props.allowedStates ?? [
ASSET_STATE.DRAFT,
ASSET_STATE.INTERNAL,
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {gettext, gettextPlural} = superdeskApi.localization;
const {numberToString} = superdeskApi.helpers;
const items = this.getMenuItems();
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (this.state.loading) {
return 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 render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {config} = this.props;
const Container = this.props.container;
const values: Array<string> | Array<number> = (() => {
if (this.props.value == 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 PackageItemPreview
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function PackageItemPreview(api, lock, superdesk, authoringWorkspace: AuthoringWorkspaceService, $sce,
desks, vocabularies) {
return {
scope: {
item: '=',
- 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 FilterSearchController
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function FilterSearchController($scope, contentFilters, notify, $filter) {
$scope.filterCondition = null;
$scope.operatorLookup = {};
$scope.valueLookup = {};
$scope.valueFieldLookup = {};
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {contact, onChange, readOnly, errors, contactType} = this.props;
const contactLabel = contactType === 'person' ? gettext('Role') : gettext('Point of contact');
const isRequired = get(this.state, 'requiredField', 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 TemplatesDirective
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
export function TemplatesDirective(notify, api, templates, modal, desks, weekdays, content, $filter, session, _) {
Function MediaMetadata
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function MediaMetadata(userList, archiveService, metadata, $timeout) {
return {
scope: {
item: '=',
},
- 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 TextWithMentions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const TextWithMentions: React.FunctionComponent<IProps> = ({message}) => {
const n = message.length;
const r = []; // array of components to render
let m; // regexp match
- 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 UploadController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$scope,
$q,
upload,
api,
archiveService,
Function UserListDirective
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function UserListDirective(keyboardManager, usersService, asset, session) {
return {
templateUrl: asset.templateUrl('apps/users/views/user-list-item.html'),
scope: {
roles: '=',
- 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 isAllowedMediaType
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function isAllowedMediaType(scope, event) {
const {allowAudio, allowPicture, allowVideo} = scope;
const VALID_MEDIA_TYPES = ['Files'];
if (allowAudio) {
- 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 AuthoringContainerDirective
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function AuthoringContainerDirective(authoringWorkspace: AuthoringWorkspaceService) {
function AuthoringContainerController() {
var self = this;
this.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 MetadataCtrl
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$scope, desks, metadata, privileges, datetimeHelper, userList,
preferencesService, archiveService, moment, content) {
Function handleKey
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
handleKey(event) {
if (querySelectorParent(event.target, 'button', {self: true}) != null) {
// don't execute key bindings when a button inside the list item is focused.
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 getAuthoringField
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function getAuthoringField(
fieldId: string,
item: IArticle,
customFieldsVocabularies: Array<IVocabulary>,
): IAuthoringField {
- 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 DashboardController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$scope,
desks,
dashboardWidgets,
api,
session,
Function SavedSearches
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
export function SavedSearches($rootScope, api, session, modal, notify, asset, $location,
desks, privileges, savedSearch): ng.IDirective {
Function arrayToTree
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function arrayToTree<T>(
itemsFlat: Array<T>,
getId: (item: T) => string,
getParentId: (item: T) => string | undefined | null,
): {result: Array<ITreeNode<T>>, errors: Array<T>} {
- 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"