thepracticaldev/dev.to

View on GitHub
app/javascript/article-form/articleForm.jsx

Summary

Maintainability
C
1 day
Test Coverage
F
37%

File articleForm.jsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { h, Component } from 'preact';
import PropTypes from 'prop-types';
import linkState from 'linkstate';
import postscribe from 'postscribe';
import { submitArticle, previewArticle } from './actions';
Severity: Minor
Found in app/javascript/article-form/articleForm.jsx - About 3 hrs to fix

    ArticleForm has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class ArticleForm extends Component {
      static handleGistPreview() {
        const els = document.getElementsByClassName('ltag_gist-liquid-tag');
        for (let i = 0; i < els.length; i += 1) {
          postscribe(els[i], els[i].firstElementChild.outerHTML);
    Severity: Minor
    Found in app/javascript/article-form/articleForm.jsx - About 2 hrs to fix

      Function render has 75 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

        render() {
          const {
            title,
            tagList,
            bodyMarkdown,
      Severity: Major
      Found in app/javascript/article-form/articleForm.jsx - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status