JouzaLoL/better-zastupovani

View on GitHub

Showing 25 of 30 total issues

File app.ts has 562 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// NPM Modules
import {
    addYears,
    closestIndexTo,
    compareDesc,
Severity: Major
Found in src/script/app.ts - About 1 day to fix

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

    function suplovaniToTable(head, body) {
        const thead =
            `<tr> ${
                head.map((col) => {
                    return `<th>${col}</th>`;
    Severity: Major
    Found in src/tv.ts and 1 other location - About 5 hrs to fix
    src/index.ts on lines 102..130

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 151.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    function suplovaniToTable(head, body) {
        const thead =
            `<tr> ${
                head.map((col) => {
                    return `<th>${col}</th>`;
    Severity: Major
    Found in src/index.ts and 1 other location - About 5 hrs to fix
    src/tv.ts on lines 107..135

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 151.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        function initialize() {
            driver = new Driver({
                animate: true,
                opacity: 0.6,
                stageBackground: "white",
    Severity: Major
    Found in src/script/app.ts - About 4 hrs to fix

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

      function filterSupl(suplovani: string[][]) {
          return suplovani.filter((row) => {
              let lessonNumber = row[1][0];
              const lessonLength = row[1].match(/\(([0-9])\)/) || 0;
              if (lessonLength) {
      Severity: Major
      Found in src/tv.ts and 1 other location - About 4 hrs to fix
      src/index.ts on lines 91..100

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 119.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      function filterSupl(suplovani: string[][]) {
          return suplovani.filter((row) => {
              let lessonNumber = row[1][0];
              const lessonLength = row[1].match(/\(([0-9])\)/) || 0;
              if (lessonLength) {
      Severity: Major
      Found in src/index.ts and 1 other location - About 4 hrs to fix
      src/tv.ts on lines 96..105

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 119.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          if (suplovaniForToday.parsedSuplovani.length == 0) {
              $("#table_suplovani")[0].innerHTML = `<div style="text-align: center; padding: 20px">
      Žádné zastupování
      </div>`;
      
      
      Severity: Major
      Found in src/index.ts and 1 other location - About 3 hrs to fix
      src/tv.ts on lines 64..73

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 102.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          if (suplovaniForToday.parsedSuplovani.length == 0) {
              $("#table_suplovani")[0].innerHTML = `<div style="text-align: center; padding: 20px">
      Žádné zastupování
      </div>`;
      
      
      Severity: Major
      Found in src/tv.ts and 1 other location - About 3 hrs to fix
      src/index.ts on lines 60..69

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 102.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          export function renderSuplovani(suplovaniRecords: SuplovaniRecord[]) {
              const suplovaniTable = Selectors.SuplovaniTable.find("tbody");
      
              const content = suplovaniRecords.length
                  ? suplovaniRecords.map(RenderHandler.suplovaniRecordToTr).join("")
      Severity: Major
      Found in src/script/app.ts and 1 other location - About 3 hrs to fix
      src/script/app.ts on lines 400..408

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 96.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          export function renderNahradniUcebny(nahradniUcebnyRecords: NahradniUcebnaRecord[]) {
              const nahradniUcebnyTable = Selectors.NahradniUcebnyTable.find("tbody");
      
              const content = nahradniUcebnyRecords.length
                  ? nahradniUcebnyRecords.map(RenderHandler.nahradniUcebnaRecordToTr).join("")
      Severity: Major
      Found in src/script/app.ts and 1 other location - About 3 hrs to fix
      src/script/app.ts on lines 294..302

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 96.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      function sortSupl(rows: string[][]) {
          return rows.sort((a, b) => {
              const hourA = a[1][0];
              const hourB = b[1][0];
      
      
      Severity: Major
      Found in src/tv.ts and 1 other location - About 2 hrs to fix
      src/index.ts on lines 82..89

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 82.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      function sortSupl(rows: string[][]) {
          return rows.sort((a, b) => {
              const hourA = a[1][0];
              const hourB = b[1][0];
      
      
      Severity: Major
      Found in src/index.ts and 1 other location - About 2 hrs to fix
      src/tv.ts on lines 87..94

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 82.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

              beforeEach(() => {
                  cy.get(test('datePicker')).as('datePicker');
                  cy.get(test('suplovaniTable')).as('suplovaniTable');
                  cy.get(test('filterTextbox')).as('filterTextbox');
              });
      Severity: Major
      Found in cypress/integration/integration_spec.js and 1 other location - About 2 hrs to fix
      cypress/integration/integration_spec.js on lines 37..41

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 81.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

              beforeEach(() => {
                  cy.get(test('button_today')).as('todayButton');
                  cy.get(test('button_tomorrow')).as('tomorrowButton');
                  cy.get(test('suplovaniTable')).as('suplovaniTable');
              });
      Severity: Major
      Found in cypress/integration/integration_spec.js and 1 other location - About 2 hrs to fix
      cypress/integration/integration_spec.js on lines 92..96

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 81.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function bootstrap has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function bootstrap() {
          Raven.config("https://9d2a2a92d6d84dc08743bfb197a5cb65@sentry.io/296434").install();
          addBackToTop({
              backgroundColor: "#002c5f",
              diameter: 56,
      Severity: Minor
      Found in src/script/app.ts - About 1 hr to fix

        Function loadData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function loadData() {
            const API = new SOLAPI();
            const today = new Date();
        
            let dateToDisplay = today;
        Severity: Minor
        Found in src/tv.ts - About 1 hr to fix

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

              export function renderDozory(dozorRecords: DozorRecord[], hide = false) {
                  const dozoryRow = Selectors.DozoryRow;
                  if (hide) {
                      dozoryRow.html("");
                      return;
          Severity: Minor
          Found in src/script/app.ts - About 1 hr to fix

            Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                export function render(suplovaniPage: SuplovaniPage | undefined, filter?: string) {
                    // Filter only - load records from state
                    if (filter) {
                        // Function for filtering records by string
                        const filterRecords = <T>(records: T[], filterString: string) => {
            Severity: Minor
            Found in src/script/app.ts - About 1 hr to fix

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

              async function loadData() {
                  const API = new SOLAPI();
                  const today = new Date();
              
                  let dateToDisplay = today;
              Severity: Minor
              Found in src/index.ts - About 1 hr to fix

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

                function bootstrap() {
                    Raven.config("https://9d2a2a92d6d84dc08743bfb197a5cb65@sentry.io/296434").install();
                
                    /* First load */
                    loadData().catch((e) => {
                Severity: Minor
                Found in src/index.ts and 1 other location - About 55 mins to fix
                src/tv.ts on lines 34..41

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 53.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language