Covivo/mobicoop

View on GitHub
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js

Summary

Maintainability
F
2 wks
Test Coverage

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

    if(global.userParams.Justification != false){
      fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.JustificationFieldset.id});
      legend = document.createElement( 'legend' );
      legendText = document.createTextNode( config.JustificationLegend.lang[ langRef ] );
      legend.appendChild( legendText );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 493..516
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 522..545
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 580..603

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

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

    if(global.userParams.Font != false){
      fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.DyslexiaFieldset.id});
      legend = document.createElement( 'legend' );
      legendText = document.createTextNode( config.DyslexiaLegend.lang[ langRef ] );
      legend.appendChild( legendText );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 522..545
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 551..574
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 580..603

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

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

    if(global.userParams.ImageReplacement != false){
      fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.ImageReplacementFieldset.id});
      legend = document.createElement( 'legend' );
      legendText = document.createTextNode( config.ImageReplacementLegend.lang[ langRef ] );
      legend.appendChild( legendText );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 493..516
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 522..545
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 551..574

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

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

    if(global.userParams.LineSpacing != false){
      fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.LineSpacingFieldset.id});
      legend = document.createElement( 'legend' );
      legendText = document.createTextNode( config.LineSpacingLegend.lang[ langRef ] );
      legend.appendChild( legendText );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 493..516
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 551..574
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 580..603

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

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

  function replaceImgSpan(){
    for (j = 0, len = global.imgSpan.length; j < len; j++ ){
      if( global.imgSpan[j].parentNode ){
        var parent = global.imgSpan[j].parentNode;
        global.imgSpan[j] = parent.replaceChild( global.imgTab[j], global.imgSpan[j] );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 719..726

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

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

  function replaceImg(){
    for (j = 0, len = global.imgTab.length; j < len; j++ ){
      if( global.imgTab[j].parentNode ){
        var parent = global.imgTab[j].parentNode;
        global.imgTab[j] = parent.replaceChild( global.imgSpan[j], global.imgTab[j] );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 727..734

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

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

    for (i = 0, len = allFieldset.length; i < len; i++ ){
      global.userParams.FormFieldset ? allFieldset[i].classList.add( userPrefix+global.userParams.FormFieldset ) :
        allFieldset[i].classList.add( userPrefix+'-'+config.FormFieldset.classSetting );
    }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 615..618

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

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

    for (i = 0, len = allLegend.length; i < len; i++ ){
      global.userParams.FormFieldsetLegend ?     allLegend[i].classList.add( userPrefix+global.userParams.FormFieldsetLegend ) :
        allLegend[i].classList.add( userPrefix+'-'+config.LegendFieldset.classSetting );
    }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 608..611

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

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

      global.userParams.ModalTitle ? titleWindow.classList.add( userPrefix+global.userParams.ModalTitle ) :
        titleWindow.classList.add( userPrefix+'-'+config.ModalContainer.titleClass );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 432..433

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

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

      global.userParams.ModalCloseButton ? CClose.classList.add( userPrefix+global.userParams.ModalCloseButton ) :
        CClose.classList.add( userPrefix+'-'+config.CloseButton.classSetting );
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 425..426

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

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

      if(global.userParams.Font != false){
        global.mode = userPrefix+'-'+config.DyslexiaFieldset.id;
        global.cookieName = 'font';
        setEvent();
      }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 364..368
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 376..380
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 382..386

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

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

      if(global.userParams.Contrast != false){
        global.mode = userPrefix+'-'+config.ContrastFieldset.id;
        global.cookieName = 'contrast';
        setEvent();
      }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 370..374
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 376..380
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 382..386

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

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

      if(global.userParams.Justification != false){
        global.mode = userPrefix+'-'+config.JustificationFieldset.id;
        global.cookieName = 'justification';
        setEvent();
      }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 364..368
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 370..374
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 376..380

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

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

      if(global.userParams.LineSpacing != false){
        global.mode = userPrefix+'-'+config.LineSpacingFieldset.id;
        global.cookieName = 'line-spacing';
        setEvent();
      }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 364..368
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 370..374
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 382..386

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

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

    for (i = 0, len = checkBoxList.length; i < len; i++ ){
      checkBoxList[i].addEventListener( 'click', function(){
        setAdaptive( this );
      }, false);
    }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 356..360

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

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

        for (i = 0, len = otherOpenButton.length; i < len; i++ ){
          otherOpenButton[i].addEventListener( 'click', function(){
            dialog( this );
          }, false);
        }
client/src/MobicoopBundle/Resources/assets/js/config/accessconfig.js on lines 652..656

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

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