superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function ContentProfilesController has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function ContentProfilesController($scope: IScope, $location, notify, content, modal, $q) {
    var self = this;

    // info bubble
    $scope.showInfoBubble = true;

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

export function SubscribersDirective(
    notify, api, subscribersService, adminPublishSettingsService,
    modal, contentFilters, $q, $filter, products, $rootScope,
) {
    return {
Severity: Minor
Found in scripts/apps/publish/directives/SubscribersDirective.ts - About 1 hr 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 getPlaceAdapter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function getPlaceAdapter(): IFieldAdapter<IArticle> {
    const useGeoNamesApi = sdApi.config.featureEnabled('places_autocomplete');

    if (useGeoNamesApi) {
        return {
Severity: Minor
Found in scripts/apps/authoring-react/field-adapters/place.ts - About 1 hr 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 componentDidMount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    componentDidMount() {
        document.addEventListener('keydown', this.handleKeydown);
        document.addEventListener('click', this.handleClickOutside);

        if (this.dom.root) {
Severity: Minor
Found in scripts/apps/contacts/components/Popup/Popup.tsx - About 1 hr 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 UserSelectList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function UserSelectList($filter, api) {
    return {
        scope: {
            exclude: '=?',
            onchoose: '&',
Severity: Minor
Found in scripts/apps/desks/directives/UserSelectList.ts - About 1 hr 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 ContactList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function ContactList(
    $timeout,
    $filter,
    search,
    datetime,
Severity: Minor
Found in scripts/apps/contacts/directives/ContactList.ts - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in scripts/apps/settings/settings.tsx - About 1 hr 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 PopulateAuthorsController has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function PopulateAuthorsController($scope: IScope, roles: IRolesService, session: ISession) {
    if (!$scope._editable) {
        return;
    }

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

export function LockService($q, api, session, privileges, notify) {
    /**
     * Lock an item
     */
    this.lock = function lock(item, force, action) {
Severity: Minor
Found in scripts/apps/authoring/authoring/services/LockService.ts - About 1 hr 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 WorkqueueCtrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function WorkqueueCtrl(
    $scope,
    $rootScope,
    $route,
    workqueue: WorkqueueService,
Severity: Minor
Found in scripts/apps/authoring/workqueue/workqueue.ts - About 1 hr 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 getSortedFields has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const getSortedFields = (
    section: 'header' | 'content',
    editor: any,
    item: IArticle,
    hideMedia: boolean,
Severity: Minor
Found in scripts/apps/authoring/preview/utils.ts - About 1 hr 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 getSortedFieldsFiltered has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const getSortedFieldsFiltered = (
    section: 'header' | 'content',
    editor: any,
    item: IArticle,
    hideMedia: boolean,
Severity: Minor
Found in scripts/apps/authoring/preview/utils.ts - About 1 hr 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 VersioningController has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function VersioningController($scope, authoring, desks, archiveService) {
    $scope.last = null;
    $scope.versions = null;
    $scope.selected = null;
    $scope.users = null;
Severity: Minor
Found in scripts/apps/authoring/versioning/versions/versions.ts - About 1 hr 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 SearchTags has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function SearchTags($location, tags, asset, metadata, desks, $rootScope) {
    return {
        scope: {
            urlParams: '=',
        },
Severity: Minor
Found in scripts/apps/search/directives/SearchTags.ts - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        const {items, tabs, onClose, onError, onDataChange} = this.props;
        const {activeTab} = this.state;
        const markupV2 = authoringReactViewEnabled && this.props.markupV2 === true;
        const handleUnsavedChanges = this.props.handleUnsavedChanges ?? handleUnsavedChangesDefault;
Severity: Minor
Found in scripts/core/interactive-article-actions-panel/index-ui.tsx - About 1 hr 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 getItemsToLoad has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function getItemsToLoad<T>(
    loadedItems: Map<number, T>,
    totalItemsCount: number,
    viewportIndexStart: number,
    viewportIndexEnd: number,
Severity: Minor
Found in scripts/core/ui/components/virtual-lists/virtual-list.tsx - About 1 hr 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 componentDidMount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    componentDidMount() {
        document.addEventListener('keydown', this.handleKeydown);
        document.addEventListener('click', this.handleClickOutside);

        if (this.dom.root) {
Severity: Minor
Found in scripts/core/ui/components/Popup/Popup.tsx - About 1 hr 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 replaceAllForEachBlock has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function replaceAllForEachBlock(
    contentState: ContentState,
    regex: RegExp, // a global regex must be passed
    replaceWith: string,
): ContentState {
Severity: Minor
Found in scripts/core/editor3/helpers/find-replace.tsx - About 1 hr 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 onSubmit has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    onSubmit(linkType) {
        let link;
        const {suggestingMode, localDomains} = this.props;
        const _createLinkSuggestion = this.props.createLinkSuggestion;
        const _applyLink = this.props.applyLink;
Severity: Minor
Found in scripts/core/editor3/components/links/LinkInput.tsx - About 1 hr 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 allowEditSuggestion has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const allowEditSuggestion = (editorState, author, isBackward) => {
    const selection = editorState.getSelection();
    let newEditorState;
    let tmpEditorState;

Severity: Minor
Found in scripts/core/editor3/helpers/suggestions.ts - About 1 hr 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