Showing 3,654 of 3,654 total issues
Function StreamController
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function StreamController($scope, api, $rootScope, desks) {
$scope.desk = null;
$scope.activities = null;
$scope.pageLength = 10;
$scope.max_results = $scope.pageLength;
- 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 MultieditDropdownDirective
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function MultieditDropdownDirective(workqueue, multiEdit, $route) {
return {
templateUrl: 'scripts/apps/authoring/multiedit/views/sd-multiedit-dropdown.html',
link: function(scope) {
scope.current = $route.current.params.item;
- 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 select
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
select(item: IArticle, event) {
// Don't select item / open preview when a button is clicked.
// The button can be three dots menu, bulk actions checkbox, a button to preview existing highlights etc.
if (isButtonClicked(event)) {
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 loadPlanningModals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
loadPlanningModals() {
const session = ng.get('session');
const superdesk = ng.get('superdesk');
const activityService: IActivityService = ng.get('activityService');
- 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 SearchPanel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function SearchPanel($location,
desks,
privileges,
asset,
metadata,
- 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 gettextReact
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const gettextReact = (
text: string,
params: {[placeholder: string]: string | number | React.ComponentType},
): Array<JSX.Element> => {
let matches: Array<{index: number, str: string, placeholder: string}> = [];
- 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 getTabLabel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getTabLabel(id: IArticleActionInteractive) {
if (id === 'send_to') {
return gettext('Send to');
} else if (id === 'fetch_to') {
return gettext('Fetch to');
- 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 saveOrUpdateSavedSearch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function saveOrUpdateSavedSearch(api, savedSearchOriginal: ISavedSearch, savedSearchChanged: ISavedSearch) {
if (savedSearchChanged.filter != null && savedSearchChanged.filter.query != null) {
savedSearchChanged.filter.query = mapFiltersClientToServer(savedSearchChanged.filter.query);
}
- 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 SavedSearches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function SavedSearches($rootScope, api, session, modal, notify, asset, $location,
desks, privileges, savedSearch): ng.IDirective {
return {
templateUrl: asset.templateUrl('apps/search/views/saved-searches.html'),
scope: {},
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const items: Array<{id: string; label: string}> = this.props.formField.component_parameters.items;
if (this.props.previewOutput) {
if (this.props.value == null) {
- 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 scrollListItemIfNeeded
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const scrollListItemIfNeeded = (selectedIndex, listRefElement) => {
if (listRefElement.children.length > 0) {
const activeElement = listRefElement.children[selectedIndex];
if (activeElement) {
- 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 getInitialPublishingDateOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getInitialPublishingDateOptions(items: Array<IArticle>): IPublishingDateOptions {
return {
embargo: items.length === 1 && items[0].embargo != null
? fromServerDateFormat(items[0].embargo) ?? null
: null,
- 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 addTag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
addTag(tag) {
if (tag) {
const valueText = get(tag, this.props.valueKey, tag);
// If the tag is not currently in the list of tags
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const renditions = this.props.item.renditions;
const guid = this.props.item.guid;
if (renditions == null) {
- 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 DatepickerDirective
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function DatepickerDirective($document) {
return {
scope: {
dt: '=ngModel',
disabled: '=ngDisabled',
- 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 hasNextSelection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function hasNextSelection(editorState, selection, backward = false) {
const currentSelection = editorState.getSelection();
const content = editorState.getCurrentContent();
const startBlock = content.getBlockForKey(selection.getStartKey());
const endBlock = content.getBlockForKey(selection.getEndKey());
- 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 mediaQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function mediaQuery($window, authoringWorkspace: AuthoringWorkspaceService) {
return {
scope: {
minWidth: '=',
maxWidth: '=',
- 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 getDraftCharacterListForSelection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getDraftCharacterListForSelection(
editorState: EditorState,
selection: SelectionState,
): List<CharacterMetadata> {
// including all blocks
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {noBorder, noPadding, grow, justifyContent, ellipsisAndGrow, children, bold = false, title} = this.props;
const cssClasses = [];
var styles: CSSProperties = {};
- 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 setAddSuggestionForCharacter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const setAddSuggestionForCharacter = (editorState, data, text, inlineStyle = null) => {
const crtInlineStyle = inlineStyle || editorState.getCurrentInlineStyle();
const selection = editorState.getSelection();
const beforeStyle =
Highlights.getHighlightStyleAtOffset(editorState, changeSuggestionsTypes, selection, -1) as string;
- 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"