davide-casiraghi/ci-global-calendar

View on GitHub

Showing 24 of 47 total issues

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

    public function createOrganizersByCountriesChart()
    {
        $organizersByCountries = Organizer::leftJoin('countries', 'organizers.country_id', '=', 'countries.id')
                        ->select(DB::raw('count(*) as organizer_count, countries.name as country_name'))
                        ->groupBy('country_id')
Severity: Major
Found in app/Http/Controllers/StatisticsController.php and 1 other location - About 4 hrs to fix
app/Http/Controllers/StatisticsController.php on lines 175..200

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

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 createTeachersByCountriesChart()
    {
        $teachersByCountries = Teacher::leftJoin('countries', 'teachers.country_id', '=', 'countries.id')
                        ->select(DB::raw('count(*) as teacher_count, countries.name as country_name'))
                        ->groupBy('country_id')
Severity: Major
Found in app/Http/Controllers/StatisticsController.php and 1 other location - About 4 hrs to fix
app/Http/Controllers/StatisticsController.php on lines 209..234

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

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

namespace App\Mail;

use Illuminate\Bus\Queueable;
Severity: Major
Found in app/Mail/MassMailing.php and 1 other location - About 3 hrs to fix
app/Mail/ContactForm.php on lines 1..50

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

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

namespace App\Mail;

use Illuminate\Bus\Queueable;
Severity: Major
Found in app/Mail/ContactForm.php and 1 other location - About 3 hrs to fix
app/Mail/MassMailing.php on lines 1..50

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

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 getColumns($postBody)
    {
        // Find plugin occurrences
        $ptn = '/{# +cardsCarousel +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +(category_id|posts_shown|posts_max_number|show_images|round_images|show_category_title|limit_chars)=\[(.*)\] +#}/';

Severity: Major
Found in app/Classes/CardsCarouselClass.php and 1 other location - About 3 hrs to fix
app/Classes/ColumnsClass.php on lines 105..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 149.

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 getColumns($postBody)
    {
        // Find plugin occurrences
        $ptn = '/{# +columns +(category_id|show_images|round_images|show_category_title)=\[(.*)\] +(category_id|show_images|round_images|show_category_title)=\[(.*)\] +(category_id|show_images|round_images|show_category_title)=\[(.*)\] +(category_id|show_images|round_images|show_category_title)=\[(.*)\] +#}/';

Severity: Major
Found in app/Classes/ColumnsClass.php and 1 other location - About 3 hrs to fix
app/Classes/CardsCarouselClass.php on lines 103..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 149.

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

        if ($searchKeywords || $orientation) {
            $backgroundImages = DB::table('background_images')
            ->when($searchKeywords, function ($query, $searchKeywords) {
                return $query->where('credits', $searchKeywords)->orWhere('credits', 'like', '%'.$searchKeywords.'%');
            })
Severity: Major
Found in app/Http/Controllers/BackgroundImageController.php and 1 other location - About 2 hrs to fix
app/Http/Controllers/UserController.php on lines 36..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 138.

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

        if ($searchKeywords || $searchCountry) {
            $users = DB::table('users')
               ->when($searchKeywords, function ($query, $searchKeywords) {
                   return $query->where('name', $searchKeywords)->orWhere('name', 'like', '%'.$searchKeywords.'%');
               })
Severity: Major
Found in app/Http/Controllers/UserController.php and 1 other location - About 2 hrs to fix
app/Http/Controllers/BackgroundImageController.php on lines 28..39

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

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

    public function getStatsDonate($postBody)
    {
        // Find plugin occurrences
        $ptn = '/{# +stats_donate +(coding_hours|pm_hours|steering_commitee_meetings|languages_number)=\[(.*)\] +(coding_hours|pm_hours|steering_commitee_meetings|languages_number)=\[(.*)\] +(coding_hours|pm_hours|steering_commitee_meetings|languages_number)=\[(.*)\] +(coding_hours|pm_hours|steering_commitee_meetings|languages_number)=\[(.*)\] +#}/';

Severity: Major
Found in app/Classes/StatsDonateClass.php and 2 other locations - About 1 hr to fix
app/Classes/CommunityGoalsClass.php on lines 24..48
app/Classes/PaypalButtonClass.php on lines 22..46

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

    public function getPaypalButton($postBody)
    {
        // Find plugin occurrences
        $ptn = '/{# +paypal_button +(button_id)=\[(.*)\] #}/';

Severity: Major
Found in app/Classes/PaypalButtonClass.php and 2 other locations - About 1 hr to fix
app/Classes/CommunityGoalsClass.php on lines 24..48
app/Classes/StatsDonateClass.php on lines 27..51

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

    public function getCommunityGoals($postBody)
    {
        // Find plugin occurrences
        $ptn = '/{# +community_goals +(backed_amount|goal_amount|backers_number|days_left)=\[(.*)\] +(backed_amount|goal_amount|backers_number|days_left)=\[(.*)\] +(backed_amount|goal_amount|backers_number|days_left)=\[(.*)\] +(backed_amount|goal_amount|backers_number|days_left)=\[(.*)\] +#}/';

Severity: Major
Found in app/Classes/CommunityGoalsClass.php and 2 other locations - About 1 hr to fix
app/Classes/PaypalButtonClass.php on lines 22..46
app/Classes/StatsDonateClass.php on lines 27..51

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

var blueIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-blue.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var greyIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-grey.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var redIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-red.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var blackIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-black.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71

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

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

var violetIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-violet.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var orangeIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-orange.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var goldIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-gold.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var greenIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-green.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 46..53
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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

var yellowIcon = new L.Icon({
    iconUrl: '/storage/leaflet-color-markers/img/marker-icon-2x-yellow.png',
    shadowUrl: '/storage/leaflet-color-markers/img/marker-shadow.png',
    iconSize: [25, 41],
    iconAnchor: [12, 41],
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 1..8
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 10..17
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 19..26
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 28..35
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 37..44
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 55..62
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 64..71
storage/app/public/leaflet-color-markers/js/leaflet-color-markers.js on lines 73..80

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

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