dsifford/academic-bloggers-toolkit

View on GitHub

Showing 1,811 of 1,811 total issues

File fieldmaps.ts has 1134 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { HTMLProps } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
 
interface BaseField<T = string> {
readonly key: T;
Severity: Major
Found in src/js/utils/fieldmaps.ts - About 2 days to fix

    Function get_website_meta has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    function get_website_meta() {
    if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    wp_send_json_error( [], 501 );
    exit;
    }
    Severity: Minor
    Found in src/php/endpoints.php - About 6 hrs to fix

    Function ToolbarMenu has 129 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function ToolbarMenu() {
    const { parseCitations, parseFootnotes, removeAllCitations } = useDispatch(
    'abt/data',
    );
    const { setSidebarSortMode, setSidebarSortOrder } = useDispatch('abt/ui');
    Severity: Major
    Found in src/js/gutenberg/sidebar/toolbar-menu.tsx - About 5 hrs to fix

      Function ReferenceFormManual has 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ReferenceFormManual(props: Props) {
      const [errorMessage, setErrorMessage] = useState('');
      const [data, setData] = useState<CSL.Data>({
      id: '',
      type: 'webpage',
      Severity: Major
      Found in src/js/gutenberg/components/reference-form-manual/index.tsx - About 5 hrs to fix

        Function Sidebar has 125 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function Sidebar() {
        const { parseCitations, parseFootnotes, updateReference } = useDispatch(
        'abt/data',
        );
        const { toggleItemSelected } = useDispatch('abt/ui');
        Severity: Major
        Found in src/js/gutenberg/sidebar/sidebar.tsx - About 5 hrs to fix

          Method get_website_meta has 119 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function get_website_meta() {
          if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
          wp_send_json_error( [], 501 );
          exit;
          }
          Severity: Major
          Found in src/php/endpoints.php - About 4 hrs to fix

            Function StyleSearch has 104 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function StyleSearch(props: Props) {
            const [inputValue, setInputValue] = useState(props.value.label);
            const [suggestions, setSuggestions] = useState<Style[]>([]);
            const [isLoading, setIsLoading] = useState(false);
             
             
            Severity: Major
            Found in src/js/components/style-search/index.tsx - About 4 hrs to fix

              Function StyleForm has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function StyleForm() {
              const [style, setStyle] = useState(SAVED_STYLE);
              const [errorMessage, setErrorMessage] = useState('');
               
              return (
              Severity: Major
              Found in src/js/options-page/style-form.tsx - About 3 hrs to fix

                Function StaticBibEdit has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function StaticBibEdit(props: Props) {
                const {
                attributes: { orderedList, items },
                setAttributes,
                } = props;
                Severity: Major
                Found in src/js/gutenberg/blocks/static-bibliography/edit.tsx - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <section
                  aria-label={__('Footnotes', 'academic-bloggers-toolkit')}
                  className="abt-footnotes"
                  >
                  <hr />
                  Severity: Major
                  Found in src/js/gutenberg/blocks/footnotes/edit.tsx and 1 other location - About 2 hrs to fix
                  src/js/gutenberg/blocks/footnotes/save.tsx on lines 12..29

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <section
                  aria-label={__('Footnotes', 'academic-bloggers-toolkit')}
                  className="abt-footnotes"
                  role="region"
                  >
                  Severity: Major
                  Found in src/js/gutenberg/blocks/footnotes/save.tsx and 1 other location - About 2 hrs to fix
                  src/js/gutenberg/blocks/footnotes/edit.tsx on lines 11..27

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  return (
                  <ol className="abt-bibliography__body" {...containerAttrs}>
                  {atts.items.map(({ content, id }) => (
                  <RichText.Content
                  key={id}
                  Severity: Major
                  Found in src/js/gutenberg/blocks/bibliography/edit.tsx and 1 other location - About 2 hrs to fix
                  src/js/gutenberg/blocks/bibliography/save.tsx on lines 58..69

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  return (
                  <ol className="abt-bibliography__body" {...containerAttrs}>
                  {atts.items.map(({ content, id }) => (
                  <RichText.Content
                  key={id}
                  Severity: Major
                  Found in src/js/gutenberg/blocks/bibliography/save.tsx and 1 other location - About 2 hrs to fix
                  src/js/gutenberg/blocks/bibliography/edit.tsx on lines 143..154

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  <input
                  required
                  autoComplete="off"
                  data-lpignore="true"
                  placeholder={__(
                  Severity: Major
                  Found in src/js/gutenberg/components/people-fields/index.tsx and 2 other locations - About 2 hrs to fix
                  src/js/gutenberg/components/people-fields/index.tsx on lines 91..107
                  src/js/gutenberg/components/people-fields/index.tsx on lines 108..124

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  <input
                  required
                  autoComplete="off"
                  data-lpignore="true"
                  placeholder={__(
                  Severity: Major
                  Found in src/js/gutenberg/components/people-fields/index.tsx and 2 other locations - About 2 hrs to fix
                  src/js/gutenberg/components/people-fields/index.tsx on lines 91..107
                  src/js/gutenberg/components/people-fields/index.tsx on lines 128..144

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  <input
                  required
                  autoComplete="off"
                  data-lpignore="true"
                  placeholder={__(
                  Severity: Major
                  Found in src/js/gutenberg/components/people-fields/index.tsx and 2 other locations - About 2 hrs to fix
                  src/js/gutenberg/components/people-fields/index.tsx on lines 108..124
                  src/js/gutenberg/components/people-fields/index.tsx on lines 128..144

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

                  export default function IdentifierForm(props: Props) {
                  const { setIdentifierKind } = useDispatch('abt/ui');
                  const kind = useSelect(select => select('abt/ui').getIdentifierKind());
                   
                  const [value, setValue] = useState('');
                  Severity: Major
                  Found in src/js/gutenberg/components/reference-form-identifier/index.tsx - About 2 hrs to fix

                    File webpack.config.ts has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable @typescript-eslint/no-var-requires */
                    import { promises as fs } from 'fs';
                    import path from 'path';
                    import { promisify } from 'util';
                     
                     
                    Severity: Minor
                    Found in webpack.config.ts - About 2 hrs to fix

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      people: [
                      {
                      key: 'author',
                      label: __('Author', 'academic-bloggers-toolkit'),
                      },
                      Severity: Major
                      Found in src/js/utils/fieldmaps.ts and 2 other locations - About 1 hr to fix
                      src/js/utils/fieldmaps.ts on lines 145..162
                      src/js/utils/fieldmaps.ts on lines 460..477

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      people: [
                      {
                      key: 'author',
                      label: __('Author', 'academic-bloggers-toolkit'),
                      },
                      Severity: Major
                      Found in src/js/utils/fieldmaps.ts and 2 other locations - About 1 hr to fix
                      src/js/utils/fieldmaps.ts on lines 145..162
                      src/js/utils/fieldmaps.ts on lines 369..386
                      Severity
                      Category
                      Status
                      Source
                      Language