changeweb/Unifiedtransform

View on GitHub

Showing 50 of 50 total issues

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

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
database/migrations/2021_08_29_083216_create_courses_table.php on lines 1..36
database/migrations/2021_08_29_083429_create_promotions_table.php on lines 1..36
database/migrations/2021_08_29_083504_create_exam_rules_table.php on lines 1..36

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

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

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
database/migrations/2021_08_29_083216_create_courses_table.php on lines 1..36
database/migrations/2021_08_29_083504_create_exam_rules_table.php on lines 1..36
database/migrations/2021_08_29_084041_create_syllabi_table.php on lines 1..36

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

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

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
database/migrations/2021_08_29_083429_create_promotions_table.php on lines 1..36
database/migrations/2021_08_29_083504_create_exam_rules_table.php on lines 1..36
database/migrations/2021_08_29_084041_create_syllabi_table.php on lines 1..36

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

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

Method create has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create(Request $request)
    {
        if($request->query('class_id') == null){
            return abort(404);
        }
Severity: Minor
Found in app/Http/Controllers/AttendanceController.php - About 1 hr to fix

    Function index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function index(Request $request)
        {
            $class_id = $request->query('class_id', 0);
            $section_id = $request->query('section_id', 0);
            $course_id = $request->query('course_id', 0);
    Severity: Minor
    Found in app/Http/Controllers/MarkController.php - About 1 hr 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

    Function showCourseMark has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function showCourseMark(Request $request)
        {
            $session_id = $request->query('session_id');
            $semester_id = $request->query('semester_id');
            $class_id = $request->query('class_id');
    Severity: Minor
    Found in app/Http/Controllers/MarkController.php - About 1 hr 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

    Method rules has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function rules()
        {
            return [
                'first_name'        => 'required|string',
                'last_name'         => 'required|string',
    Severity: Minor
    Found in app/Http/Requests/StudentStoreRequest.php - About 1 hr to fix

      Method calendarEvents has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function calendarEvents(Request $request)
          {
              $current_school_session_id = $this->getSchoolCurrentSession();
              $event = null;
              switch ($request->type) {
      Severity: Minor
      Found in app/Http/Controllers/EventController.php - About 1 hr to fix

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

            public function getCourseAttendance($class_id, $course_id, $session_id) {
                try {
                    return Attendance::with('student')
                                    ->where('class_id', $class_id)
                                    ->where('course_id', $course_id)
        Severity: Minor
        Found in app/Repositories/AttendanceRepository.php and 1 other location - About 55 mins to fix
        app/Repositories/AttendanceRepository.php on lines 38..49

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

        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

            public function getSectionAttendance($class_id, $section_id, $session_id) {
                try {
                    return Attendance::with('student')
                                    ->where('class_id', $class_id)
                                    ->where('section_id', $section_id)
        Severity: Minor
        Found in app/Repositories/AttendanceRepository.php and 1 other location - About 55 mins to fix
        app/Repositories/AttendanceRepository.php on lines 51..62

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

        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

        <?php
        
        use Illuminate\Database\Migrations\Migration;
        use Illuminate\Database\Schema\Blueprint;
        use Illuminate\Support\Facades\Schema;
        database/migrations/2021_08_29_083021_create_sections_table.php on lines 1..35
        database/migrations/2021_08_29_084030_create_events_table.php on lines 1..35
        database/migrations/2021_10_09_061039_create_grading_systems_table.php on lines 1..35

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

        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

        <?php
        
        use Illuminate\Database\Migrations\Migration;
        use Illuminate\Database\Schema\Blueprint;
        use Illuminate\Support\Facades\Schema;
        database/migrations/2021_08_29_082900_create_semesters_table.php on lines 1..35
        database/migrations/2021_08_29_083021_create_sections_table.php on lines 1..35
        database/migrations/2021_08_29_084030_create_events_table.php on lines 1..35

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

        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

        <?php
        
        use Illuminate\Database\Migrations\Migration;
        use Illuminate\Database\Schema\Blueprint;
        use Illuminate\Support\Facades\Schema;
        Severity: Major
        Found in database/migrations/2021_08_29_084030_create_events_table.php and 3 other locations - About 55 mins to fix
        database/migrations/2021_08_29_082900_create_semesters_table.php on lines 1..35
        database/migrations/2021_08_29_083021_create_sections_table.php on lines 1..35
        database/migrations/2021_10_09_061039_create_grading_systems_table.php on lines 1..35

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

        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

        <?php
        
        use Illuminate\Database\Migrations\Migration;
        use Illuminate\Database\Schema\Blueprint;
        use Illuminate\Support\Facades\Schema;
        database/migrations/2021_08_29_082900_create_semesters_table.php on lines 1..35
        database/migrations/2021_08_29_084030_create_events_table.php on lines 1..35
        database/migrations/2021_10_09_061039_create_grading_systems_table.php on lines 1..35

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

        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

        Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                AcademicSettingInterface $academicSettingRepository,
                SchoolSessionInterface $schoolSessionRepository,
                SchoolClassInterface $schoolClassRepository,
                SectionInterface $schoolSectionRepository,
                UserInterface $userRepository,
        Severity: Major
        Found in app/Http/Controllers/AcademicSettingController.php - About 50 mins to fix

          Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  AcademicSettingInterface $academicSettingRepository,
                  UserInterface $userRepository,
                  SchoolSessionInterface $schoolSessionRepository,
                  SchoolClassInterface $schoolClassRepository,
                  SectionInterface $schoolSectionRepository,
          Severity: Major
          Found in app/Http/Controllers/MarkController.php - About 50 mins to fix

            Method getAllByStudentId has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function getAllByStudentId($session_id, $semester_id, $class_id, $section_id, $course_id, $student_id) {
            Severity: Minor
            Found in app/Repositories/MarkRepository.php - About 45 mins to fix

              Method getAllFinalMarksByStudentId has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function getAllFinalMarksByStudentId($session_id, $student_id, $semester_id, $class_id, $section_id, $course_id);
              Severity: Minor
              Found in app/Interfaces/MarkInterface.php - About 45 mins to fix

                Method getAllByStudentId has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function getAllByStudentId($session_id, $semester_id, $class_id, $section_id, $course_id, $student_id);
                Severity: Minor
                Found in app/Interfaces/MarkInterface.php - About 45 mins to fix

                  Method getAllFinalMarksByStudentId has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function getAllFinalMarksByStudentId($session_id, $student_id, $semester_id, $class_id, $section_id, $course_id) {
                  Severity: Minor
                  Found in app/Repositories/MarkRepository.php - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language