casefoundation/weekly-roundup

View on GitHub
client/src/actions/Article/ArticleActions.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function articleCreate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function articleCreate(article_group_id, urls = [], group_order_start = 0) {
  // Validate urls
  let validationError;
  if (urls.length === 0) {
    validationError = 'Please provide at least one url to analyze.';
Severity: Minor
Found in client/src/actions/Article/ArticleActions.js - About 1 hr to fix

    Function articleUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function articleUpdate(id, title, url, published, source, summary, group_order_shift) {
      let validateError;
      if (!validateUrl(url, true)) {
        validateError = `Invalid Url Format: ${url}`;
      } else if (!validateString(title, 0, 255, true)) {
    Severity: Minor
    Found in client/src/actions/Article/ArticleActions.js - About 1 hr to fix

      Function articleUpdate has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function articleUpdate(id, title, url, published, source, summary, group_order_shift) {
      Severity: Major
      Found in client/src/actions/Article/ArticleActions.js - About 50 mins to fix

        There are no issues that match your filters.

        Category
        Status