intranet/static/themes/snow/snow.js

Summary

Maintainability
D
3 days
Test Coverage

File snow.js has 417 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Iodine (Intranet2) Snow Script
 * Credits: dmorris, zyaro
 * Modified for Ion (Intranet3) by: 2016jwoglom, 2025azhu
 */
$(function () {
Severity: Minor
Found in intranet/static/themes/snow/snow.js - About 6 hrs to fix

    Function initsnow has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function initsnow() {
                set_urlvars();
    
                /*if (document.body.classList) {
                document.body.classList.add("has-snow");
    Severity: Major
    Found in intranet/static/themes/snow/snow.js - About 2 hrs to fix

      Function movesnow_pile has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function movesnow_pile() {
                  if (santaexists) {
                      santax += santaspeed;
                      if (santax >= screenwidth + santawidth) {
                          santax = -santawidth;
      Severity: Minor
      Found in intranet/static/themes/snow/snow.js - About 1 hr to fix

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

                    if (santaexists) {
                        santax += santaspeed;
                        if (santax >= screenwidth + santawidth) {
                            santax = -santawidth;
                            santa.style.top = Math.floor(Math.random() * screenheight - santaheight) + "px";
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 2 other locations - About 3 hrs to fix
        intranet/static/themes/snow/snow.js on lines 440..447
        intranet/static/themes/snow/snow.js on lines 464..471

        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

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

                    if (santaexists) {
                        santax += santaspeed;
                        if (santax >= screenwidth + santawidth) {
                            santax = -santawidth;
                            santa.style.top = Math.floor(Math.random() * screenheight - santaheight) + "px";
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 2 other locations - About 3 hrs to fix
        intranet/static/themes/snow/snow.js on lines 391..398
        intranet/static/themes/snow/snow.js on lines 440..447

        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

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

                    if (santaexists) {
                        santax += santaspeed;
                        if (santax >= screenwidth + santawidth) {
                            santax = -santawidth;
                            santa.style.top = Math.floor(Math.random() * screenheight - santaheight) + "px";
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 2 other locations - About 3 hrs to fix
        intranet/static/themes/snow/snow.js on lines 391..398
        intranet/static/themes/snow/snow.js on lines 464..471

        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

                        snowflakes[i].style.left = (snowflakes[i].x + 10 * Math.sin(snowy[i] / 9)) + "px";
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 1 other location - About 1 hr to fix
        intranet/static/themes/snow/snow.js on lines 455..455

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

        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

                        snowflakes[i].style.left = (snowflakes[i].x + 10 * Math.sin(snowy[i] / 9)) + "px";
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 1 other location - About 1 hr to fix
        intranet/static/themes/snow/snow.js on lines 480..480

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

        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

                        snowflakes[i].style.color = snowcolor[Math.floor(Math.random() * snowcolor.length)];
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 3 other locations - About 35 mins to fix
        intranet/static/themes/snow/snow.js on lines 358..358
        intranet/static/themes/snow/snow.js on lines 416..416
        intranet/static/themes/snow/snow.js on lines 417..417

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

        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

                        snowflakes[i].style.fontFamily = snowtype[Math.floor(Math.random() * snowtype.length)];
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 3 other locations - About 35 mins to fix
        intranet/static/themes/snow/snow.js on lines 357..357
        intranet/static/themes/snow/snow.js on lines 416..416
        intranet/static/themes/snow/snow.js on lines 417..417

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

        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

                                snowflakes[i].style.color = snowcolor[Math.floor(Math.random() * snowcolor.length)];
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 3 other locations - About 35 mins to fix
        intranet/static/themes/snow/snow.js on lines 357..357
        intranet/static/themes/snow/snow.js on lines 358..358
        intranet/static/themes/snow/snow.js on lines 417..417

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

        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

                                snowflakes[i].style.fontFamily = snowtype[Math.floor(Math.random() * snowtype.length)];
        Severity: Major
        Found in intranet/static/themes/snow/snow.js and 3 other locations - About 35 mins to fix
        intranet/static/themes/snow/snow.js on lines 357..357
        intranet/static/themes/snow/snow.js on lines 358..358
        intranet/static/themes/snow/snow.js on lines 416..416

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

        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