Showing 3,654 of 3,654 total issues
Function BlockRendererComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const BlockRendererComponent: React.StatelessComponent<any> = (props) => {
const {block, contentState} = props;
const entityKey = block.getEntityAt(0);
if (!entityKey) {
- 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 getInitialContent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function getInitialContent(props): ContentState {
// support standalone instance of editor3 which is not connected to item field
if (props.editorState != null) {
var contentState = convertFromRaw(
props.editorState instanceof Array
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
readOnly,
locked,
showToolbar,
- 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 setDeleteSuggestionForCharacter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const setDeleteSuggestionForCharacter = (editorState, data) => {
const selection = editorState.getSelection();
const paragraphStyle = Highlights.getHighlightStyleAtOffset(editorState, paragraphSuggestionTypes, selection, -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 constructor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
constructor() {
this.ingestRepo = element(by.id('ingest-collection'));
this.archiveRepo = element(by.id('archive-collection'));
this.publishedRepo = element(by.id('published-collection'));
this.archivedRepo = element(by.id('archived-collection'));
- 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 UserNotificationsService
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function UserNotificationsService(
$rootScope,
$timeout,
api,
session,
- 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 activate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
activate: () => {
const result: IExtensionActivationResult = privileges.hasPrivilege('rundowns')
? {
contributions: {
pages: privileges.hasPrivilege('rundowns')
Function clear
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
clear = function clear(id, key) {
var zap = function zap(what) {
if (isDefined(what[id][key])) {
delete what[id][key];
if (Object.keys(what[id]).length === 0) {
Function uploadFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
uploadFile(item: IUploadItem, onProgress: (event: ProgressEvent) => void): Promise<Partial<IAssetItem>> {
const {gettext} = superdeskApi.localization;
const {notify} = superdeskApi.ui;
const data = new FormData();
Function onPrepare
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
onPrepare: function() {
execSync(
`
echo "chrome version:" && $CHROME_BIN --version
echo "\n"
Function extractTranslations
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extractTranslations(clientDir) {
for (const {extensionRootPath} of getExtensionDirectoriesSync(clientDir)) {
const package = JSON.parse(fs.readFileSync(path.join(extensionRootPath, 'package.json'), 'utf-8'));
const paths = _.get(package, 'superdeskExtension.translations-extract-paths');
Function exportHighlight
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function exportHighlight(id: IArticle['_id'], hasUnsavedChanges: boolean): Promise<void> {
const request = () => {
return httpRequestJsonLocal<void>({
method: 'POST',
path: '/generate_highlights',
Function workspaceReducer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function workspaceReducer(
state: IWorkspaceState = initialState,
action: IWorkspaceActionTypes,
): IWorkspaceState {
switch (action.type) {
Function openDeleteConfirmationModal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function openDeleteConfirmationModal(assetName?: string, asset_length?: number): Promise<boolean> {
const {gettext} = superdeskApi.localization;
const {confirm} = superdeskApi.ui;
const el = document.createElement('div');
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<AuthoringWidgetLayout
header={(
<AuthoringWidgetHeading
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const config: IDropdownConfig = this.props.config ?? {
source: 'vocabulary',
vocabularyId: null,
multiple: false,
Function onTrigger
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
onTrigger: () => {
const article = getLatestItem();
Promise.all([
httpRequestJsonLocal<IRestApiResponse<IArticle>>({
Function initializeEditor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeEditor() {
if (this.state.ready === true) {
this.setState({ready: false});
}
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(api, $location, sort, search, metadata) {
this.api = api;
this.$location = $location;
this.sort = sort;
this.sortOptions = [
Function getCount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCount() {
var criteria = {
source: {
query: {
filtered: {