EmmaRamirez/Clickopolis

View on GitHub
src/components/template.ts

Summary

Maintainability
F
4 days
Test Coverage

File template.ts has 818 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Achievement, Biome, BiomeType, Building, Citizen, Civilization,
         Collection, Economy, Era, FaithBonus, FaithTier, Game, Leader, Legacy,
         log, Nation, notify, Queue, Resource, Robot, Settings, SocialPolicy,
         Soldier, Tech, generateTooltips, updateTooltip, betterUpdateTooltip,
         Trait, Wonder
Severity: Major
Found in src/components/template.ts - About 1 day to fix

    Function createResourcesScreen has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createResourcesScreen(playerCiv:Civilization, resources:Collection<Resource>) {
        let resourcesScreen = `
          <section class='screen resources-screen' id='resources'>
            <h2 data-tooltip='Resources are nice.'><img src='img/resources.png'> Resources</h2>
            <section class='resources-screen-inner'>
    Severity: Major
    Found in src/components/template.ts - About 4 hrs to fix

      Function createCivilizationScreen has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        createCivilizationScreen(playerCiv:Civilization):string {
          let civilizationScreen = `
            <section class='screen civilization-screen' id='civilization'>
              <h2><img src='img/empire.png'> Civilization</h2>
              <section class='civilization-screen-inner'>
      Severity: Major
      Found in src/components/template.ts - About 4 hrs to fix

        Templates has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class Templates {
        
          createStartScreen(playerCiv:Civilization, game:Game) {
        
            let startScreen = `
        Severity: Minor
        Found in src/components/template.ts - About 2 hrs to fix

          Function createDiplomacyScreen has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            createDiplomacyScreen(playerCiv:Civilization) {
              let diplomacyScreen = `
              <section class='screen diplomacy-screen' id='diplomacy'>
                <h2>
                  <img src='img/deal.png'> Diplomacy
          Severity: Major
          Found in src/components/template.ts - About 2 hrs to fix

            Function createCultureScreen has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              createCultureScreen(playerCiv:Civilization) {
                let cultureScreen = `
                  <section class='screen culture-screen' id='culture'>
                    <div class='expand culture-expand' title='Expand the screen size.'>
                      <img src='img/expand.png'>
            Severity: Minor
            Found in src/components/template.ts - About 1 hr to fix

              Function createSettingsScreen has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                createSettingsScreen(playerCiv:Civilization, game:Game) {
                  let settingsScreen = `
                    <section class='screen settings-screen' id='settings'>
                      <h2>
                        <img src='img/gear.png'> Settings
              Severity: Minor
              Found in src/components/template.ts - About 1 hr to fix

                Function createEconomyScreen has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  createEconomyScreen(playerCiv:Civilization) {
                    let economyScreen = `
                      <section class='screen economy-screen' id='economy'>
                        <h2><img src='img/money.png'> Economy</h2>
                        <section class='economy-screen-inner'>
                Severity: Minor
                Found in src/components/template.ts - About 1 hr to fix

                  Function createScreenHeader has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    createScreenHeader(playerCiv:Civilization, game:Game):string {
                      let screenHeader = `
                        <header class='screen-header'>
                          <div class='player-info'>
                            <img src='img/${u.dasherize(playerCiv.leader.name)}.jpg'>
                  Severity: Minor
                  Found in src/components/template.ts - About 1 hr to fix

                    Function createTechnologyScreen has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      createTechnologyScreen(playerCiv:Civilization) {
                        let technologyScreen = `
                          <section class='screen technology-screen' id='technology'>
                            <h2><img src='img/research.png'> Technology</h2>
                            <section class='technology-screen-inner'>
                    Severity: Minor
                    Found in src/components/template.ts - About 1 hr to fix

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

                        createMenuScreen() {
                          let menuScreen = `
                            <section class='screen menu-screen' id='menu'>
                              <section class='menu-screen-inner'>
                                <h3>menu</h3>
                      Severity: Minor
                      Found in src/components/template.ts - About 1 hr to fix

                        There are no issues that match your filters.

                        Category
                        Status