Showing 3,654 of 3,654 total issues
Function ItemActionsMenu
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function ItemActionsMenu(
superdesk,
activityService: IActivityService,
workflowService,
archiveService,
- 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 handleKey
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
handleKey(event) {
const {scope} = this.props;
const {Keys} = this.props.svc;
let diff;
- 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 HighlightsService
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function HighlightsService(api, $q, $cacheFactory, packages: IPackagesService, privileges) {
var service: any = {};
var promise = {};
var cache = $cacheFactory('highlightList');
- 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 MetaTagsDirective
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function MetaTagsDirective(api, $timeout) {
var ENTER = 13;
var ESC = 27;
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 SearchMenuController
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export default function SearchMenuController(
$rootScope, $scope, $filter, $location, $route, searchProviderService, api, savedSearch,
privileges,
) {
let providerLabels = {};
- 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 AuthoringWidgetsDir
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function AuthoringWidgetsDir(desks, commentsService, $injector) {
return {
controller: WidgetsManagerCtrl,
templateUrl: 'scripts/apps/authoring/widgets/views/authoring-widgets.html',
transclude: true,
- 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 getLeftRangeAndTextForStyle
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function getLeftRangeAndTextForStyle(editorState, style) {
const type = getHighlightTypeFromStyleName(style);
const selection = editorState.getSelection();
const content = editorState.getCurrentContent();
let startBlock = content.getBlockForKey(selection.getStartKey());
- 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 processSuggestion
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const processSuggestion = (state, {data, suggestion}, accepted) => {
if (accepted === true || accepted === false) {
// after clicking accept/reject editor focus is lost
// restore the focus so undo stack is correct
// and pop up can be positioned properly on undo SDFID-401
- 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 getSpellcheckingDecorator
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function getSpellcheckingDecorator(
language: string,
spellcheckWarnings: ISpellcheckWarningsByBlock,
{disableContextMenu = false} = {},
) {
- 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
File PublishQueueController.ts
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import {isSuperdeskContent} from 'apps/workspace/helpers/isSuperdeskContent';
import {gettext} from 'core/utils';
PublishQueueController.$inject = [
File RelatedItemsDirective.ts
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {gettext} from 'core/utils';
import {AuthoringWorkspaceService} from 'apps/authoring/authoring/services/AuthoringWorkspaceService';
import {IArticle, IVocabulary, IRendition} from 'superdesk-api';
import {IDirectiveScope} from 'types/Angular/DirectiveScope';
import {getAssociationsByFieldId} from '../../authoring/authoring/controllers/AssociationController';
Function link
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, elem) {
scope.workspaceConfig = appConfig.workspace || {}; // it's used in workspaceMenu.filter
scope.badges = {};
Function handleSave
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSave() {
const {gettext} = this.props.superdesk.localization;
const {session, instance} = this.props.superdesk;
const host = instance.config.server.url;
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {svc, contact, onCancel, hideActionBar, formClass} = this.props;
const {
isFormValid = false,
dirty = false,
Function link
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope) {
scope.$watch('step.current', (step, previous) => {
if (step === 'people') {
scope.search = null;
scope.deskMembers = [];
Function save
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
save() {
const {svc} = this.props;
const {notify, contacts} = svc;
const origContact = this.state.originalContact;
Function resetUser
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resetUser() {
clearOrigUserWatcher();
clearUserWatcher();
scope.dirty = false;
Function MacrosReplaceDirective
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MacrosReplaceDirective(editorResolver) {
return {
scope: true,
templateUrl: 'scripts/apps/authoring/macros/views/macros-replace.html',
link: function(scope) {
Function RenditionsService
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function RenditionsService(metadata, $q, api, superdesk, _) {
var self = this;
/**
* ngdoc method
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {loading} = this.state;
return (
<div className="widget-container">