superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function WebSocketProxy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function WebSocketProxy($rootScope, $interval, session, SESSION_EVENTS) {
    var ws = null;
    var connectTimer = -1;
    var TIMEOUT = 5000;

Severity: Minor
Found in scripts/core/notification/notification.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 PopupService has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function PopupService($document) {
    var service: any = {};

    service.position = function(width, height, target) {
        // taking care of screen size and responsiveness
Severity: Minor
Found in scripts/core/ui/ui.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 DeployConfigFactory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function DeployConfigFactory(api, $q) {
    /**
     * Deploy config service
     *
     * provides deployment related config from server
Severity: Minor
Found in scripts/core/config.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 openNewItemForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    openNewItemForm(initialValues?: {[key: string]: any}) {
        if (this.state.editItem != null || this.state.newItem != null) {
            this.modal.alert({
                headerText: gettext('Warning'),
                bodyText: gettext(
Severity: Minor
Found in scripts/core/ui/components/ListPage/generic-list-page.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 WeekdayPickerDirective has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function WeekdayPickerDirective(weekdays) {
    return {
        templateUrl: 'scripts/core/ui/views/weekday-picker.html',
        scope: {
            model: '=',
Severity: Minor
Found in scripts/core/ui/ui.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 multiSelectDirective has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function multiSelectDirective() {
    return {
        scope: {
            item: '=',
            list: '=',
Severity: Minor
Found in scripts/core/ui/ui.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 TimepickerPopupDirective has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function TimepickerPopupDirective($timeout) {
    return {
        templateUrl: 'scripts/core/ui/views/sd-timepicker-popup.html',
        scope: {
            open: '=',
Severity: Minor
Found in scripts/core/ui/ui.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 onToggle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    onToggle(type, active) {
        const author = getCurrentAuthor();
        const {editorState, suggestingMode, toggleInlineStyle, createChangeStyleSuggestion} = this.props;
        const selection = editorState.getSelection();

Severity: Minor
Found in scripts/core/editor3/components/toolbar/InlineStyleButtons.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(props) {
        super(props);

        // when non-null, holds the entity whos URL is being edited
        this.entity = null;
Severity: Minor
Found in scripts/core/editor3/components/links/LinkInput.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 createSplitParagraphSuggestion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const createSplitParagraphSuggestion = (state, {data}) => {
    const type = 'SPLIT_PARAGRAPH_SUGGESTION';
    let {editorState} = state;
    const isMergeParagraphAfter = isMergeParagraph(editorState, data);
    const checkState = Highlights.changeEditorSelection(editorState, -1, -1, false);
Severity: Minor
Found in scripts/core/editor3/reducers/suggestions.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 computeState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    computeState(): IState {
        const defaultState = {
            floating: false,
            width: 'auto',
        };
Severity: Minor
Found in scripts/core/editor3/components/toolbar/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 SpellcheckMenuController has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function SpellcheckMenuController($rootScope, editorResolver, spellcheck, notify, $scope) {
    this.isAuto = false;
    this.runSpellchecker = runSpellchecker;
    this.pushSettings = pushSettings;
    var self = this;
Severity: Minor
Found in scripts/core/spellcheck/spellcheck.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    constructor() {
        var self = this;

        this.checkbox = element(by.model('provider.is_default'));
        this.addSourceButton = element(by.css('[ng-click="edit()"]'));
Severity: Minor
Found in e2e/client/specs/helpers/pages.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 flipVertically has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function flipVertically(placement: PopperInstance['state']['placement']): PopperInstance['state']['placement'] {
    if (placement === 'top') {
        return 'bottom';
    } else if (placement === 'bottom') {
        return 'top';
Severity: Minor
Found in scripts/core/popper-utils.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

Severity
Category
Status
Source
Language