XoopsModules25x/smallworld

View on GitHub
editprofile.php

Summary

Maintainability
B
6 hrs
Test Coverage

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

            if (0 != smallworldGetValfromArray('interests', 'smallworldusethesefields')) {
                $interests = $item->textarea('interests', 'interests', _SMALLWORLD_INTERESTS, 1, 20, 'favourites', $preset = stripslashes($r['interests']));
                $xoopsTpl->append('interests', $interests);
            } else {
                $xoopsTpl->assign('show_interests', 'no');
Severity: Major
Found in editprofile.php and 5 other locations - About 45 mins to fix
editprofile.php on lines 227..232
editprofile.php on lines 235..240
editprofile.php on lines 243..248
editprofile.php on lines 251..256
editprofile.php on lines 259..264

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

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

            if (0 != smallworldGetValfromArray('favouritetvshows', 'smallworldusethesefields')) {
                $tvshow = $item->textarea('tvshow', 'tvshow', _SMALLWORLD_TVSHOW, 1, 20, 'favourites', $preset = stripslashes($r['tvshow']));
                $xoopsTpl->append('tvshow', $tvshow);
            } else {
                $xoopsTpl->assign('show_tv', 'no');
Severity: Major
Found in editprofile.php and 5 other locations - About 45 mins to fix
editprofile.php on lines 219..224
editprofile.php on lines 227..232
editprofile.php on lines 243..248
editprofile.php on lines 251..256
editprofile.php on lines 259..264

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

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

            if (0 != smallworldGetValfromArray('aboutme', 'smallworldusethesefields')) {
                $aboutme = $item->textarea('aboutme', 'aboutme', _SMALLWORLD_ABOUTME, 2, 20, 'favourites', $preset = stripslashes($r['aboutme']));
                $xoopsTpl->append('aboutme', $aboutme);
            } else {
                $xoopsTpl->assign('show_aboutme', 'no');
Severity: Major
Found in editprofile.php and 5 other locations - About 45 mins to fix
editprofile.php on lines 219..224
editprofile.php on lines 227..232
editprofile.php on lines 235..240
editprofile.php on lines 243..248
editprofile.php on lines 251..256

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

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

            if (0 != smallworldGetValfromArray('favouritemovies', 'smallworldusethesefields')) {
                $movie = $item->textarea('movie', 'movie', _SMALLWORLD_MOVIE, 1, 20, 'favourites', $preset = stripslashes($r['movie']));
                $xoopsTpl->append('movie', $movie);
            } else {
                $xoopsTpl->assign('show_movies', 'no');
Severity: Major
Found in editprofile.php and 5 other locations - About 45 mins to fix
editprofile.php on lines 219..224
editprofile.php on lines 227..232
editprofile.php on lines 235..240
editprofile.php on lines 251..256
editprofile.php on lines 259..264

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

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

            if (0 != smallworldGetValfromArray('favouritemusic', 'smallworldusethesefields')) {
                $music = $item->textarea('music', 'music', _SMALLWORLD_MUSIC, 1, 20, 'favourites', $preset = stripslashes($r['music']));
                $xoopsTpl->append('music', $music);
            } else {
                $xoopsTpl->assign('show_music', 'no');
Severity: Major
Found in editprofile.php and 5 other locations - About 45 mins to fix
editprofile.php on lines 219..224
editprofile.php on lines 235..240
editprofile.php on lines 243..248
editprofile.php on lines 251..256
editprofile.php on lines 259..264

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

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

            if (0 != smallworldGetValfromArray('favouritebooks', 'smallworldusethesefields')) {
                $books = $item->textarea('books', 'books', _SMALLWORLD_BOOKS, 1, 20, 'favourites', $preset = stripslashes($r['books']));
                $xoopsTpl->append('books', $books);
            } else {
                $xoopsTpl->assign('show_books', 'no');
Severity: Major
Found in editprofile.php and 5 other locations - About 45 mins to fix
editprofile.php on lines 219..224
editprofile.php on lines 227..232
editprofile.php on lines 235..240
editprofile.php on lines 243..248
editprofile.php on lines 259..264

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

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 (0 != smallworldGetValfromArray('lookingfor', 'smallworldusethesefields')) {
                $nr1         = unserialize($r['searchrelat']);
                $searchrelat = $item->RetrieveRadio('searchrelat', $arr03, $nr1, $selected = null);
                $xoopsTpl->append('searchrelat', $searchrelat);
            } else {
Severity: Minor
Found in editprofile.php and 1 other location - About 40 mins to fix
editprofile.php on lines 74..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 93.

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 (0 != smallworldGetValfromArray('interestedin', 'smallworldusethesefields')) {
                $nr          = unserialize($r['intingender']);
                $intInGender = $item->RetrieveRadio('intingender', $arr01, $nr, $selected = null);
                $xoopsTpl->append('intingender', $intInGender);
            } else {
Severity: Minor
Found in editprofile.php and 1 other location - About 40 mins to fix
editprofile.php on lines 94..100

Duplicated Code

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

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

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

Tuning

This issue has a mass of 93.

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 (0 != smallworldGetValfromArray('streetadress', 'smallworldusethesefields')) {
                $adress = $item->input('adress', 'adress', 'adress', $size = '50', $preset = stripslashes($r['adress']));
                $xoopsTpl->append('adress', $adress);
            } else {
                $xoopsTpl->assign('show_adress', 'no');
Severity: Minor
Found in editprofile.php and 1 other location - About 30 mins to fix
editprofile.php on lines 111..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 90.

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 (0 != smallworldGetValfromArray('birthplace', 'smallworldusethesefields')) {
                $birthplace = $item->input('birthplace', 'birthplace', 'birthplace', $size = '50', $preset = stripslashes($r['birthplace']));
                $xoopsTpl->append('birthplace', $birthplace);
            } else {
                $xoopsTpl->assign('show_birthplace', 'no');
Severity: Minor
Found in editprofile.php and 1 other location - About 30 mins to fix
editprofile.php on lines 194..199

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

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

There are no issues that match your filters.

Category
Status