superdesk/superdesk-client-core

View on GitHub

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>,
) {
Severity: Minor
Found in scripts/apps/authoring-react/field-adapters/index.tsx - About 25 mins to fix

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,
Severity: Minor
Found in scripts/apps/authoring-react/fields/linked-items/index.tsx - About 25 mins to fix

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;
Severity: Minor
Found in scripts/apps/ingest/services/IngestProviderService.ts - About 25 mins to fix

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,
Severity: Minor
Found in scripts/apps/templates/controllers/CreateTemplateController.ts - About 25 mins to fix

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;

Severity: Minor
Found in scripts/apps/contacts/components/Form/SelectFieldSearchInput/index.tsx - About 25 mins to fix

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) {
Severity: Minor
Found in scripts/apps/contacts/helpers.ts - About 25 mins to fix

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) &&
Severity: Minor
Found in scripts/apps/templates/helpers.ts - About 25 mins to fix

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)) {
Severity: Minor
Found in scripts/apps/archive/index.tsx - About 25 mins to fix

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;
    }
Severity: Minor
Found in scripts/apps/contacts/helpers.ts - About 25 mins to fix

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) {
Severity: Minor
Found in scripts/apps/desks/controllers/DeskConfigController.ts - About 25 mins to fix

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}>
Severity: Minor
Found in scripts/apps/users/components/UserAvatar.tsx - About 25 mins to fix

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) {
Severity: Minor
Found in scripts/apps/archive/directives/MarkedItemTitle.ts - About 25 mins to fix

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) {
Severity: Minor
Found in scripts/apps/authoring/authoring/ValidateCharacters.tsx - About 25 mins to fix

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
Severity: Minor
Found in scripts/apps/authoring/authoring/services/RenditionsService.ts - About 25 mins to fix

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.
     */
Severity: Minor
Found in scripts/apps/authoring/authoring/services/ConfirmDirtyService.ts - About 25 mins to fix

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);

Severity: Minor
Found in scripts/apps/authoring/authoring/services/InitializeMediaService.ts - About 25 mins to fix

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;
Severity: Minor
Found in scripts/apps/authoring/authoring/services/InitializeMediaService.ts - About 25 mins to fix

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(() => {
Severity: Minor
Found in scripts/apps/dashboard/closed-desk/index.ts - About 25 mins to fix

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;
Severity: Minor
Found in scripts/apps/tansa/index.ts - About 25 mins to fix

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,
Severity: Minor
Found in scripts/apps/translations/services/TranslationService.ts - About 25 mins to fix

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

Severity
Category
Status
Source
Language