superdesk/superdesk-client-core

View on GitHub
scripts/apps/archive/directives/MediaPreview.ts

Summary

Maintainability
B
5 hrs
Test Coverage

Function MediaPreview has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function MediaPreview(api, $rootScope, desks, superdesk, content, storage) {
    return {
        template: require('../views/preview.html'),
        link: function(scope, elem) {
            const PREVIEW_HEADER_STATE = 'item_preview:header_state';
Severity: Major
Found in scripts/apps/archive/directives/MediaPreview.ts - About 2 hrs to fix

    Function link has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            link: function(scope, elem) {
                const PREVIEW_HEADER_STATE = 'item_preview:header_state';
    
                const setSubjectPreviewFields = () => {
                    scope.subjectPreviewFields = content.previewFields(scope.editor, scope.fields)
    Severity: Major
    Found in scripts/apps/archive/directives/MediaPreview.ts - About 2 hrs to fix

      Function MediaPreview has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function MediaPreview(api, $rootScope, desks, superdesk, content, storage) {
      Severity: Minor
      Found in scripts/apps/archive/directives/MediaPreview.ts - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status