chdemko/pandoc-numbering

View on GitHub
src/pandoc_numbering/_main.py

Summary

Maintainability
F
4 days
Test Coverage

Showing 8 of 8 total issues

File _main.py has 1453 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
 
# pylint: disable=too-many-lines
 
"""Pandoc filter to number all kinds of things."""
Severity: Major
Found in src/pandoc_numbering/_main.py - About 3 days to fix

    Numbered has 33 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Numbered:
    """
    Numbered elements.
     
    Arguments
    Severity: Minor
    Found in src/pandoc_numbering/_main.py - About 4 hrs to fix

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

      def _compute_data(self):
      # pylint: disable=too-many-statements,no-member
      classes = self._doc.defined[self._basic_category]["classes"]
      if self._alias == self._tag:
      self._set_content(
      Severity: Minor
      Found in src/pandoc_numbering/_main.py - About 1 hr to fix

        Function _compute_data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def _compute_data(self):
        # pylint: disable=too-many-statements,no-member
        classes = self._doc.defined[self._basic_category]["classes"]
        if self._alias == self._tag:
        self._set_content(
        Severity: Minor
        Found in src/pandoc_numbering/_main.py - About 55 mins to fix

        Function _compute_alias has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def _compute_alias(self):
        # Determine the final alias
        if not self._title:
        if self._section_alias:
        self._alias = (
        Severity: Minor
        Found in src/pandoc_numbering/_main.py - About 45 mins to fix

        Function meta_format has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def meta_format(
        Severity: Minor
        Found in src/pandoc_numbering/_main.py - About 35 mins to fix

          Function meta_entry has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def meta_entry(
          Severity: Minor
          Found in src/pandoc_numbering/_main.py - About 35 mins to fix

            Function _compute_title has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def _compute_title(self):
            self._title = []
            if (
            isinstance(self._get_content()[-3], Str)
            and self._get_content()[-3].text[-1:] == ")"
            Severity: Minor
            Found in src/pandoc_numbering/_main.py - About 35 mins to fix
            Category
            Status