superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function getRundownItemAuthoringStorage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getRundownItemAuthoringStorage(id: IRundownItem['_id']): IAuthoringStorage<IRundownItem> {
    class AutoSaveRundownItem implements IAuthoringAutoSave<IRundownItem> {
        get() {
            return httpRequestJsonLocal<IRundownItem>({
                method: 'GET',

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 getPartialDateFormat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function getPartialDateFormat(parts: {year?: boolean; month?: boolean; day?: boolean}): string {
    const separator = superdesk.instance.config.view.dateformat
        .replace('YYYY', '')
        .replace('MM', '')
        .replace('DD', '')[0];
Severity: Minor
Found in scripts/extensions/broadcasting/src/utils/get-partial-date-format.ts - About 35 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 prepareForDropping has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const prepareForDropping = (
    event: React.DragEvent<HTMLDivElement>,
    image: IImage | null,
) => {
    if (image == null) {

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 handleSave has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    handleSave() {
        const {gettext} = this.props.superdesk.localization;
        const {session, instance} = this.props.superdesk;
        const host = instance.config.server.url;

Severity: Minor
Found in scripts/extensions/videoEditor/src/VideoEditorThumbnail.tsx - About 35 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 handleSave has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    handleSave() {
        const {dataApi} = this.props.superdesk;
        const {gettext} = this.props.superdesk.localization;
        const {x, y, width, height} = this.state.transformations.crop;
        const crop = this.getCropRotate({x: x, y: y, width: width, height: height});
Severity: Minor
Found in scripts/extensions/videoEditor/src/VideoEditor.tsx - About 35 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 SortPackageItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function SortPackageItems() {
    return {
        link: function(scope, element) {
            var updated = false;

Severity: Minor
Found in scripts/apps/packaging/directives/SortPackageItems.ts - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        if (this.state.actions == null) {
            return (
                <MoreActionsButton
                    aria-label={gettext('Actions menu')}
Severity: Minor
Found in scripts/apps/authoring-react/subcomponents/authoring-actions-menu.tsx - About 35 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 getVocabularyItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getVocabularyItems(vocabularyId): Array<IVocabularyItem> {
        const vocabulary = sdApi.vocabularies.getAll().get(vocabularyId);

        if (vocabularyId === ANPA_CATEGORY.vocabularyId) {
            return vocabulary.items;
Severity: Minor
Found in scripts/apps/authoring-react/authoring-react.tsx - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        if (this.state.macros == null) {
            return null;
        }

Severity: Minor
Found in scripts/apps/authoring-react/macros/macros.tsx - About 35 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 Toggle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const Toggle: React.StatelessComponent<any> = ({value, onChange, readOnly, className}) => {
    const onClick = () => onChange({target: {value: !value}});
    const handleKeyDown = (event) => {
        if (event) {
            switch (event.keyCode) {
Severity: Minor
Found in scripts/apps/contacts/components/Form/Toggle.tsx - About 35 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(props: IProps) {
        super(props);
        const {svc, contact} = props;
        const {metadata} = svc;

Severity: Minor
Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        const {user} = this.props;

        if (user == null) {
            return null;
Severity: Minor
Found in scripts/apps/users/components/UserAvatar.tsx - About 35 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 MacrosReplaceDirective has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function MacrosReplaceDirective(editorResolver) {
    return {
        scope: true,
        templateUrl: 'scripts/apps/authoring/macros/views/macros-replace.html',
        link: function(scope) {
Severity: Minor
Found in scripts/apps/authoring/macros/macros.ts - About 35 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 DictionaryConfigController has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function DictionaryConfigController($scope, dictionaries, session, modal, notify) {
    $scope.dictionaries = null;
    $scope.origDictionary = null;
    $scope.dictionary = null;

Severity: Minor
Found in scripts/apps/dictionaries/controllers/DictionaryConfigController.ts - About 35 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 AssignmentIcon has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function AssignmentIcon() {
    return {
        templateUrl: 'scripts/apps/archive/views/assignment-icon.html',
        scope: {item: '='},
        link: function(scope, elem) {
Severity: Minor
Found in scripts/apps/archive/directives/AssignmentIcon.ts - About 35 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 MetaIngest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function MetaIngest(ingestSources) {
    return {
        scope: {
            item: '=',
        },
Severity: Minor
Found in scripts/apps/archive/directives/MetaIngest.ts - About 35 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 UserMentionDirective has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function UserMentionDirective(userList, desks, asset, $q) {
    return {
        templateUrl: asset.templateUrl('apps/users/views/mentions.html'),
        link: function(scope, elem) {
            scope.users = [];
Severity: Minor
Found in scripts/apps/users/directives/UserMentionDirective.ts - About 35 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 PlacesServiceFactory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function PlacesServiceFactory(api, features, metadata) {
    const geoNameToCity = (data: IGeoName): ILocated => ({
        dateline: 'city',
        country_code: data.country_code,
        tz: data.tz,
Severity: Minor
Found in scripts/apps/authoring/metadata/PlacesService.ts - About 35 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 edit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    edit(
        scope,
        item,
        options: {isNew?: boolean, customRel?: string, defaultTab?: any, showMetadata?: boolean} = {},
        callback = null,
Severity: Minor
Found in scripts/apps/authoring/authoring/controllers/AssociationController.ts - About 35 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 MetaTargetedPublishingDirective has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function MetaTargetedPublishingDirective() {
    return {
        scope: {
            list: '=',
            disabled: '=ngDisabled',
Severity: Minor
Found in scripts/apps/authoring/metadata/metadata.ts - About 35 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