EscolaLMS/API

View on GitHub

Showing 46 of 46 total issues

File curriculum.php has 1295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
return array(
"norecord"            => "No Record Found",
 "create"            => "Create New",
 "home"            => "Home",
Severity: Major
Found in resources/lang/en/curriculum.php - About 3 days to fix

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

    <?php
    
    /*
    |--------------------------------------------------------------------------
    | Validation Language Lines
    Severity: Major
    Found in resources/lang/pl/validation.php and 1 other location - About 2 days to fix
    resources/lang/pl/validation-inline.php on lines 1..133

    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 555.

    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

    <?php
    
    /*
    |--------------------------------------------------------------------------
    | Validation Language Lines
    Severity: Major
    Found in resources/lang/pl/validation-inline.php and 1 other location - About 2 days to fix
    resources/lang/pl/validation.php on lines 1..133

    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 555.

    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

    File texts.php has 524 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    //     INSERT INTO "topic_richtexts" ("id", "created_at", "updated_at", "value") VALUES
    
    return  [
        59 => ['2021-08-10 10:20:49',    '2021-08-10 10:20:49',    'Kiedy pracujemy (lub uczymy się) online jesteśmy wystawieni na wiele drobnych dystrakcji, od powiadomień z apek, które zachęcają by sprawdzić co nowego po zwykłą pokusę by uruchomić nową kartę i obejrzeć coś na YouTube. Jeśli masz problem ze skupieniem się i chcesz pomóc sobie w dokończeniu zadania lub pracy, ogranicz te dystrakcje za pomocą prostych rozwiązań takich jak blokowanie nieporządanych stron WWW czy aplikacji.
    Severity: Major
    Found in database/seeds/cyfrowy_dobrostan/texts.php - About 1 day to fix

      File ScormHelper.php has 508 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      
      namespace App\Library;
      
      
      Severity: Major
      Found in app/Library/ScormHelper.php - About 1 day to fix

        Method run has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function run(HeadlessH5PServiceContract $hh5pService)
            {
        
                $this->hh5pService = $hh5pService;
        
        
        Severity: Major
        Found in database/seeds/CyfrowyDobrostanSeeder.php - About 5 hrs to fix

          Method updateScoTracking has 136 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateScoTracking($scoUuid, $userId, $data)
              {
                  $tracking = $this->createScoTracking($scoUuid, $userId);
                  $tracking->setLatestDate(Carbon::now());
                  $sco    =   $tracking->getSco();
          Severity: Major
          Found in app/Library/ScormHelper.php - About 5 hrs to fix

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

                'content' => [
                    'creator'                        => 'Criador',
                    'created_at'                     => 'Criado em',
                    'title'                          => 'Título',
                    'content_type'                   => 'Tipo de conteúdo',
            Severity: Major
            Found in resources/lang/pt/laravel-h5p.php and 1 other location - About 5 hrs to fix
            resources/lang/en/laravel-h5p.php on lines 10..47

            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 186.

            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

                'content' => [
                    'creator'                        => 'Creator',
                    'created_at'                     => 'Created At',
                    'title'                          => 'Title',
                    'content_type'                   => 'Content Type',
            Severity: Major
            Found in resources/lang/en/laravel-h5p.php and 1 other location - About 5 hrs to fix
            resources/lang/pt/laravel-h5p.php on lines 10..47

            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 186.

            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 updateScoTracking has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateScoTracking($scoUuid, $userId, $data)
                {
                    $tracking = $this->createScoTracking($scoUuid, $userId);
                    $tracking->setLatestDate(Carbon::now());
                    $sco    =   $tracking->getSco();
            Severity: Minor
            Found in app/Library/ScormHelper.php - About 4 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                'library' => [
                    'title'                           => 'Título',
                    'name'                            => 'Nome',
                    'version'                         => 'Versão',
                    'restricted'                      => 'Restrito',
            Severity: Major
            Found in resources/lang/pt/laravel-h5p.php and 2 other locations - About 4 hrs to fix
            resources/lang/en/laravel-h5p.php on lines 48..82
            resources/lang/pl/laravel-h5p.php on lines 49..83

            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 171.

            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 3 locations. Consider refactoring.
            Open

                'library' => [
                    'title'                           => 'Title',
                    'name'                            => 'Name',
                    'version'                         => 'Version',
                    'restricted'                      => 'Restricted',
            Severity: Major
            Found in resources/lang/en/laravel-h5p.php and 2 other locations - About 4 hrs to fix
            resources/lang/pl/laravel-h5p.php on lines 49..83
            resources/lang/pt/laravel-h5p.php on lines 48..82

            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 171.

            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 3 locations. Consider refactoring.
            Open

                'library' => [
                    'title'                           => 'Tytuł',
                    'name'                            => 'Nazwa',
                    'version'                         => 'Wersja',
                    'restricted'                      => 'Zastrzeżone',
            Severity: Major
            Found in resources/lang/pl/laravel-h5p.php and 2 other locations - About 4 hrs to fix
            resources/lang/en/laravel-h5p.php on lines 48..82
            resources/lang/pt/laravel-h5p.php on lines 48..82

            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 171.

            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 3 locations. Consider refactoring.
            Open

                'h5p' => [
                    'fullscreen'            => 'Pełny ekran',
                    'disableFullscreen'     => 'Wyłącz pełny ekran',
                    'download'              => 'Pobierz',
                    'copyrights'            => 'Rights of use',
            Severity: Major
            Found in resources/lang/pl/laravel-h5p.php and 2 other locations - About 3 hrs to fix
            resources/lang/en/laravel-h5p.php on lines 83..115
            resources/lang/fr/laravel-h5p.php on lines 74..106

            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 161.

            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 3 locations. Consider refactoring.
            Open

                'h5p' => [
                    'fullscreen'            => 'Plein écran',
                    'disableFullscreen'     => 'Plein écran Désactivé',
                    'download'              => 'Télécharger',
                    'copyrights'            => 'Droits d\'utilisation',
            Severity: Major
            Found in resources/lang/fr/laravel-h5p.php and 2 other locations - About 3 hrs to fix
            resources/lang/en/laravel-h5p.php on lines 83..115
            resources/lang/pl/laravel-h5p.php on lines 84..116

            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 161.

            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 3 locations. Consider refactoring.
            Open

                'h5p' => [
                    'fullscreen'            => 'Fullscreen',
                    'disableFullscreen'     => 'Disable fullscreen',
                    'download'              => 'Download',
                    'copyrights'            => 'Rights of use',
            Severity: Major
            Found in resources/lang/en/laravel-h5p.php and 2 other locations - About 3 hrs to fix
            resources/lang/fr/laravel-h5p.php on lines 74..106
            resources/lang/pl/laravel-h5p.php on lines 84..116

            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 161.

            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 4 locations. Consider refactoring.
            Open

                'library' => [
                    'title'                           => 'Titre',
                    'restricted'                      => 'Limité',
                    'contents'                        => 'Contenu',
                    'contents_using_it'               => 'Contenu qui l\'utilise',
            Severity: Major
            Found in resources/lang/fr/laravel-h5p.php and 3 other locations - About 3 hrs to fix
            resources/lang/ar/laravel-h5p.php on lines 10..41
            resources/lang/ar/laravel-h5p.php on lines 42..73
            resources/lang/fr/laravel-h5p.php on lines 10..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 156.

            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 4 locations. Consider refactoring.
            Open

                'content' => [
                    'creator'                        => 'المنشئ',
                    'created_at'                     => 'أنشئت في',
                    'title'                          => 'عنوان',
                    'content_type'                   => 'نوع المحتوى',
            Severity: Major
            Found in resources/lang/ar/laravel-h5p.php and 3 other locations - About 3 hrs to fix
            resources/lang/ar/laravel-h5p.php on lines 42..73
            resources/lang/fr/laravel-h5p.php on lines 10..41
            resources/lang/fr/laravel-h5p.php on lines 42..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 156.

            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 4 locations. Consider refactoring.
            Open

                'content' => [
                    'creator'                        => 'Créateur',
                    'created_at'                     => 'Créé à',
                    'title'                          => 'Titre',
                    'content_type'                   => 'Type de contenu',
            Severity: Major
            Found in resources/lang/fr/laravel-h5p.php and 3 other locations - About 3 hrs to fix
            resources/lang/ar/laravel-h5p.php on lines 10..41
            resources/lang/ar/laravel-h5p.php on lines 42..73
            resources/lang/fr/laravel-h5p.php on lines 42..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 156.

            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 4 locations. Consider refactoring.
            Open

                'library' => [
                    'title'                           => 'عنوان',
                    'restricted'                      => 'محدد',
                    'contents'                        => 'المحتويات',
                    'contents_using_it'               => 'المحتويات المستخدمة',
            Severity: Major
            Found in resources/lang/ar/laravel-h5p.php and 3 other locations - About 3 hrs to fix
            resources/lang/ar/laravel-h5p.php on lines 10..41
            resources/lang/fr/laravel-h5p.php on lines 10..41
            resources/lang/fr/laravel-h5p.php on lines 42..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 156.

            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