superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function handleKeepStyleReplaceMacro has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function handleKeepStyleReplaceMacro(
    article: IArticle,
    contentProfile: IContentProfileV2,
    fieldsData: OrderedMap<string, unknown>,
): IMacroProcessor {
Severity: Minor
Found in scripts/apps/authoring-react/macros/macros.tsx - About 1 hr to fix

    Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render() {
            return (
                <div className="color-selector__list">
                    {this.props.options.map((item, index: number) => {
                        const swatchClasses = classNames('color-selector__swatch', {
    Severity: Minor
    Found in scripts/apps/authoring-react/toolbar/theme-selector.tsx - About 1 hr to fix

      Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
              const {value1, value2, config} = this.props;
      
              const str1 = (() => {
                  if (value1 == null) {
      Severity: Minor
      Found in scripts/apps/authoring-react/fields/editor3/difference.tsx - About 1 hr to fix

        Function validateWorkflow has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function validateWorkflow(
            mediaItem: IArticle,
            allowedWorkflowsConfig: Partial<typeof defaultAllowedWorkflows>,
        ): {result: true} | {result: false; error: string} {
            const allowedWorkflows = {
        Severity: Minor
        Found in scripts/apps/relations/services/RelationsService.ts - About 1 hr to fix

          Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render() {
                  const Container = this.props.container;
                  const ids = (this.props.value ?? []).map(({id}) => id);
                  const {readOnly} = this.props;
          
          
          Severity: Minor
          Found in scripts/apps/authoring-react/fields/attachments/editor.tsx - About 1 hr to fix

            Function getFieldV2 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            getFieldV2: (fieldEditor, fieldSchema) => {
                                const fieldConfig: IMediaConfig = {
                                    maxItems:
                                        vocabulary.field_options?.multiple_items?.enabled === true
                                            ? vocabulary.field_options.multiple_items.max_items
            Severity: Minor
            Found in scripts/apps/authoring-react/field-adapters/index.tsx - About 1 hr to fix

              Function buildRangeFilter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      const buildRangeFilter = (paramsObject, _filters) => {
                          // created & modified date filters
                          let hasParams = paramsObject.beforefirstcreated || paramsObject.afterfirstcreated ||
                              paramsObject.beforeversioncreated || paramsObject.afterversioncreated;
                          let zeroHourSuffix = 'T00:00:00',
              Severity: Minor
              Found in scripts/apps/content-api/services/ContentAPISearchService.ts - About 1 hr to fix

                Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    constructor(contacts, search, notify, $location, $timeout, scope, elem) {
                        this.scope = scope;
                        this.elem = elem;
                        this.containerElem = elem.find('.contacts-list__holder');
                        this.notify = notify;
                Severity: Minor
                Found in scripts/apps/contacts/directives/ContactsSearchResultsDirective.ts - About 1 hr to fix

                  Function upload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.upload = function(dictionary, data, file, success, error, progress) {
                          var hasId = _.has(dictionary, '_id') && dictionary._id !== null;
                          var method = hasId ? 'PATCH' : 'POST';
                          var headers = hasId ? {'If-Match': dictionary._etag} : {};
                          var sendData: any = {};
                  Severity: Minor
                  Found in scripts/apps/dictionaries/services/DictionaryService.ts - About 1 hr to fix

                    Function get has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        service.get = function(desk) {
                            var DEFAULT_CACHE_KEY = '_nodesk';
                            var key = desk || DEFAULT_CACHE_KEY;
                            var value = service.getSync(key);
                    
                    
                    Severity: Minor
                    Found in scripts/apps/highlights/services/HighlightsService.ts - About 1 hr to fix

                      Function HtmlPreview has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function HtmlPreview($sce, $timeout) {
                          return {
                              scope: {
                                  sdHtmlPreview: '=',
                                  item: '=?',
                      Severity: Minor
                      Found in scripts/apps/archive/directives/HtmlPreview.ts - About 1 hr to fix

                        Function UserActivityDirective has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function UserActivityDirective(profileService, asset) {
                            return {
                                restrict: 'A',
                                replace: true,
                                templateUrl: asset.templateUrl('apps/users/views/activity-feed.html'),
                        Severity: Minor
                        Found in scripts/apps/users/directives/UserActivityDirective.ts - About 1 hr to fix

                          Function validateMediaFieldsThrows has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function validateMediaFieldsThrows(validator, metadata, schema, getLabelForFieldId) {
                              const raiseError = (key) => {
                                  throw gettext('Required field {{key}} is missing. ...', {key: getLabelForFieldId(key)});
                              };
                          
                          

                            Function applyImageChanges has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                $scope.applyImageChanges = () => {
                                    let flip: 'none' | 'both' | 'horizontal' | 'vertical' = 'none';
                                    const flipH = Math.abs($scope.controls.fliph / 180 % 2);
                                    const flipV = Math.abs($scope.controls.flipv / 180 % 2);
                            
                            

                              Function MediaCopyMetadataDirective has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function MediaCopyMetadataDirective() {
                                  return {
                                      scope: {
                                          metadata: '=',
                                          validator: '=',
                              Severity: Minor
                              Found in scripts/apps/authoring/media/MediaCopyMetadataDirective.ts - About 1 hr to fix

                                Function PackagesCtrl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function PackagesCtrl($scope, superdesk, api, search) {
                                    $scope.contentItems = [];
                                
                                    function fetchPackages() {
                                        var query = search.query();
                                Severity: Minor
                                Found in scripts/apps/authoring/packages/packages.ts - About 1 hr to fix

                                  Function setRatio has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      $scope.setRatio = (ratio) => {
                                          const originalImage = $scope.data.metadata.renditions.original;
                                  
                                          let sizeW, sizeH;
                                  
                                  

                                    Function closeItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        $scope.closeItem = function(item) {
                                            autosave.hasUnsavedChanges(item).then((hasUnsavedChanges) => {
                                                if (hasUnsavedChanges) {
                                                    showUnsavedChangesPrompt().then(({action, closePromptFn}) => {
                                                        autosave.settle(item).then(() => {
                                    Severity: Minor
                                    Found in scripts/apps/authoring/workqueue/workqueue.ts - About 1 hr to fix

                                      Function fetchAuthors has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              fetchAuthors: function(code) {
                                                  var self = this;
                                      
                                                  self.values.authors = [];
                                      
                                      
                                      Severity: Minor
                                      Found in scripts/apps/authoring/metadata/metadata.ts - About 1 hr to fix

                                        Function MultieditDropdownDirective has 26 lines of code (exceeds 25 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;
                                        Severity: Minor
                                        Found in scripts/apps/authoring/multiedit/multiedit.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language