Showing 3,654 of 3,654 total issues
Function retrieveStoredValueEditor3Generic
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function retrieveStoredValueEditor3Generic(
fieldId: string,
article: IArticle,
authoringStorage: IAuthoringStorage<IArticle>,
) {
- 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 getLinkedItemsField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getLinkedItemsField(): ILinkedItemsField {
const field: ILinkedItemsField = {
id: LINKED_ITEMS_FIELD_TYPE,
label: gettext('Linked items (authoring-react)'),
editorComponent: Editor,
- 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 IngestProviderService
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function IngestProviderService(api, $q, preferencesService, $filter, searchProviderService) {
var _getAllIngestProviders = function(criteria = {}, page = 1, providers = []) {
return api.query('ingest_providers', _.extend({max_results: 200, page: page}, criteria))
.then((result) => {
let pg = page;
- 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 CreateTemplateController
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function CreateTemplateController(
item,
templates,
api,
desks,
- 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 filterDataList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
filterDataList(event) {
const {dataList, onChange, querySearch, onQuerySearch} = this.props;
const value = event.target.value;
- 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 scrollListItemIfNeeded
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const scrollListItemIfNeeded = (selectedIndex, listRefElement) => {
if (listRefElement.children.length > 0) {
let activeElement = listRefElement.children[selectedIndex];
if (activeElement) {
- 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 notifySaveError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function notifySaveError(response, notify) {
if (angular.isDefined(response.data._issues) &&
angular.isDefined(response.data._issues['validator exception'])) {
notify.error(gettext('Error: ' + response.data._issues['validator exception']));
} else if (angular.isDefined(response.data._issues) &&
- 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 spikeActivity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function spikeActivity(data, modal, $location, multi,
authoringWorkspace: AuthoringWorkspaceService, confirm, autosave, $rootScope) {
// For the sake of keyboard shortcut to work consistently,
// if the item is multi-selected, let multibar controller handle its spike
if (!data.item || multi.count > 0 && includes(multi.getIds(), data.item._id)) {
- 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 renderArea
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function renderArea(area, itemProps, props) {
// If singleline preference is set, don't show second line
if (itemProps.scope.singleLine && area === 'secondLine') {
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 calculateDiff
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function calculateDiff(editObj, origObj) {
let diff = generate(origObj, editObj) || {};
for (const key in diff) {
if (diff[key] === null && editObj[key] !== 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 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {user, displayStatus, displayAdministratorIndicator} = this.props;
return (
<LazyOrNot {...this.props}>
- 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 doIconUpdates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
doIconUpdates() {
// To do - Change this method when a multi bell icon is added for desk markings
// If highlights, add appropriate multi icon and color
if (this.scope.deskMarking) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {item, field} = this.props;
let invalidCharError = null;
if (item == null || field == 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 RenditionsService
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function RenditionsService(metadata, $q, api, superdesk, _) {
var self = this;
/**
* ngdoc method
- 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 ConfirmDirtyService
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ConfirmDirtyService($window, $q, $filter, api, modal, $interpolate, $modal) {
/**
* Will ask for user confirmation for user confirmation if there are some changes which are not saved.
* - Detecting changes via $scope.dirty - it's up to the controller to set it.
*/
- 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 computeMediaFieldVersions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function computeMediaFieldVersions(fieldId, $scope) {
$scope.mediaFieldVersions[fieldId] = [];
var field = _.find($scope.fields, (_field) => _field._id === fieldId);
- 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 getNewMediaFieldId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getNewMediaFieldId(fieldId, $scope) {
var field = _.find($scope.fields, (_field) => _field._id === fieldId);
var multipleItems = field ? _.get(field, 'field_options.multiple_items.enabled') : false;
var parts = mediaIdGenerator.getFieldParts(fieldId);
var newIndex = multipleItems ? 1 : 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 TopMenuInfoDirective
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function TopMenuInfoDirective(desks, $timeout, config) {
return {
template: require('./views/top-menu-info.html'),
link: (scope) => {
const setup = debounce(() => {
- 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 setupTansa
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const setupTansa = () => {
if (!appConfig?.tansa?.base_url) {
console.warn('tansa is not configured properly');
appConfig.features.useTansaProofing = false;
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 TranslationService
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function TranslationService(
api,
$rootScope,
notify,
authoringWorkspace: AuthoringWorkspaceService,
- 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"