fisharebest/webtrees

View on GitHub
app/Statistics/Service/CenturyService.php

Summary

Maintainability
C
1 day
Test Coverage

Method centuryName has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function centuryName(int $century): string
    {
        if ($century < 0) {
            return I18N::translate('%s BCE', $this->centuryName(-$century));
        }
Severity: Minor
Found in app/Statistics/Service/CenturyService.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

                    return strip_tags(I18N::translateContext('CENTURY', '14th'));
    Severity: Major
    Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return strip_tags(I18N::translateContext('CENTURY', '7th'));
      Severity: Major
      Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return strip_tags(I18N::translateContext('CENTURY', '2nd'));
        Severity: Major
        Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return strip_tags(I18N::translateContext('CENTURY', '11th'));
          Severity: Major
          Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return strip_tags(I18N::translateContext('CENTURY', '12th'));
            Severity: Major
            Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return strip_tags(I18N::translateContext('CENTURY', '10th'));
              Severity: Major
              Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return ($century - 1) . '01-' . $century . '00';
                Severity: Major
                Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return strip_tags(I18N::translateContext('CENTURY', '13th'));
                  Severity: Major
                  Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return strip_tags(I18N::translateContext('CENTURY', '18th'));
                    Severity: Major
                    Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return strip_tags(I18N::translateContext('CENTURY', '5th'));
                      Severity: Major
                      Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return strip_tags(I18N::translateContext('CENTURY', '1st'));
                        Severity: Major
                        Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return strip_tags(I18N::translateContext('CENTURY', '16th'));
                          Severity: Major
                          Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return strip_tags(I18N::translateContext('CENTURY', '17th'));
                            Severity: Major
                            Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return strip_tags(I18N::translateContext('CENTURY', '15th'));
                              Severity: Major
                              Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return strip_tags(I18N::translateContext('CENTURY', '9th'));
                                Severity: Major
                                Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return strip_tags(I18N::translateContext('CENTURY', '4th'));
                                  Severity: Major
                                  Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return strip_tags(I18N::translateContext('CENTURY', '6th'));
                                    Severity: Major
                                    Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      return strip_tags(I18N::translateContext('CENTURY', '8th'));
                                      Severity: Major
                                      Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                        return strip_tags(I18N::translateContext('CENTURY', '3rd'));
                                        Severity: Major
                                        Found in app/Statistics/Service/CenturyService.php - About 30 mins to fix

                                          There are no issues that match your filters.

                                          Category
                                          Status