Showing 3,654 of 3,654 total issues
Function replaceWord
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
export const replaceWord = (state, replaceWordData: IReplaceWordData, skipOnChange = false) => {
const {editorState, suggestingMode} = state;
const {word, newWord} = replaceWordData;
- 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 addColAfter
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
const addColAfter = (state) =>
processCells(state, (cells, numCols, numRows, i, j, withHeader) => ({
data: {
numRows: numRows,
numCols: numCols + 1,
- 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 SubscriberTokenController
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function SubscriberTokenController($scope, api, $rootScope) {
const subscriber = $scope.subscriber;
this.copy = copyString;
this.tokens = [];
Function componentDidMount
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentDidMount() {
const vocabularies = ng.get('vocabularies');
const content = ng.get('content');
Promise.all([
Function getEditorConfig
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getEditorConfig(contentTypeId) {
const content = ng.get('content');
const metadata = ng.get('metadata');
return Promise.all([
Function previewAuthoringEntity
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function previewAuthoringEntity(
item: any,
profile: IContentProfileV2,
fieldsData: Immutable.Map<string, any>,
label?: string,
Function gotoIngest
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.gotoIngest = function(provider) {
const contentTypes = provider.content_types;
const length = provider.content_types.includes('preformatted') || (
contentTypes.includes('planning') && contentTypes.includes('event')) ? 2 : 1;
Function ContactEditorDirective
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function ContactEditorDirective(
contacts,
notify,
privileges,
metadata,
Function ThemeSelectDirective
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function ThemeSelectDirective(authThemes) {
return {
templateUrl: 'scripts/apps/authoring/views/theme-select.html',
scope: {key: '@'},
link: function themeSelectLink(scope, elem) {
Function link
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: (scope) => {
scope.features = features;
scope.metadata = metadata;
scope.handleInputChange = (newValue: string, {field}) => {
Function editMedia
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scope.editMedia = (defaultTab = 'view') => {
let showTabs = [];
scope.mediaLoading = true;
Function link
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs) {
scope.syncWidgets = function() {
angular.forEach(scope.widgets, (widget) => {
if (widget.active) {
var sizes = scope.gridster.serialize(widget.el);
Function renderArea
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function renderArea(
area: 'firstLine' | 'secondLine' | 'singleLine' | 'priority',
itemProps: IItemProps,
props?: { className?: string },
customRender: any = {},
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function render(items, next, force?) {
scope.loading = true;
if (items) {
setScopeItems(items, force);
} else if (next) {
Function MultiImageEditDirective
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function MultiImageEditDirective(asset, $sce) {
return {
scope: {
imagesOriginal: '=',
isUpload: '=',
Function toElasticFilter
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function toElasticFilter(q: ILogicalOperator | IComparison) {
if (isLogicalOperator(q)) {
const r = {};
if (q['$and'] != null) {
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const DropdownButton = this.props.customButton ?? defaultButton;
return (
<DropZone3
Function toElasticQuery
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function toElasticQuery(q: ISuperdeskQuery): {q?: string; source: string} {
interface IQuery {
query?: {
filtered: {
filter?: {};
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<Modal
visible
zIndex={1050}
Function handleBeforeInputHighlights
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function handleBeforeInputHighlights(
onChange,
chars: string,
editorState: EditorState,
): DraftHandleValue {