Semantic-Org/Semantic-UI

View on GitHub
src/definitions/globals/site.js

Summary

Maintainability
F
1 wk
Test Coverage

Function site has 389 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.site = $.fn.site = function(parameters) {
  var
    time           = new Date().getTime(),
    performance    = [],

Severity: Major
Found in src/definitions/globals/site.js - About 1 day to fix

    File site.js has 444 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * # Semantic UI - Site
     * http://github.com/semantic-org/semantic-ui/
     *
     *
    Severity: Minor
    Found in src/definitions/globals/site.js - About 6 hrs to fix

      Function invoke has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          invoke: function(query, passedArguments, context) {
            var
              object = instance,
              maxDepth,
              found,
      Severity: Major
      Found in src/definitions/globals/site.js - About 2 hrs to fix

        Function setting has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              setting: function(setting, value, modules, modifyExisting) {
                modules = (typeof modules === 'string')
                  ? (modules === 'all')
                    ? settings.modules
                    : [modules]
        Severity: Minor
        Found in src/definitions/globals/site.js - About 1 hr to fix

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

              invoke: function(query, passedArguments, context) {
                var
                  object = instance,
                  maxDepth,
                  found,
          Severity: Major
          Found in src/definitions/globals/site.js and 11 other locations - About 2 days to fix
          src/definitions/behaviors/api.js on lines 950..1003
          src/definitions/behaviors/visibility.js on lines 1132..1185
          src/definitions/modules/accordion.js on lines 482..535
          src/definitions/modules/checkbox.js on lines 698..751
          src/definitions/modules/dimmer.js on lines 580..633
          src/definitions/modules/dropdown.js on lines 3621..3674
          src/definitions/modules/embed.js on lines 501..554
          src/definitions/modules/nag.js on lines 365..418
          src/definitions/modules/progress.js on lines 769..822
          src/definitions/modules/sidebar.js on lines 873..926
          src/definitions/modules/tab.js on lines 802..855

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

          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

              disable: {
                console: function() {
                  module.console(false);
                },
                debug: function(modules, modifyExisting) {
          Severity: Major
          Found in src/definitions/globals/site.js and 1 other location - About 5 hrs to fix
          src/definitions/globals/site.js on lines 189..203

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

          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

              enable: {
                console: function() {
                  module.console(true);
                },
                debug: function(modules, modifyExisting) {
          Severity: Major
          Found in src/definitions/globals/site.js and 1 other location - About 5 hrs to fix
          src/definitions/globals/site.js on lines 204..218

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

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

              internal: function(name, value) {
                if( $.isPlainObject(name) ) {
                  $.extend(true, module, name);
                }
                else if(value !== undefined) {
          Severity: Major
          Found in src/definitions/globals/site.js and 24 other locations - About 1 hr to fix
          src/definitions/behaviors/api.js on lines 860..870
          src/definitions/behaviors/form.js on lines 1037..1047
          src/definitions/behaviors/form.js on lines 1048..1058
          src/definitions/behaviors/visibility.js on lines 1031..1041
          src/definitions/behaviors/visibility.js on lines 1042..1052
          src/definitions/globals/site.js on lines 255..265
          src/definitions/modules/checkbox.js on lines 608..618
          src/definitions/modules/dimmer.js on lines 487..497
          src/definitions/modules/dropdown.js on lines 3531..3541
          src/definitions/modules/embed.js on lines 408..418
          src/definitions/modules/modal.js on lines 787..797
          src/definitions/modules/nag.js on lines 275..285
          src/definitions/modules/popup.js on lines 1150..1160
          src/definitions/modules/popup.js on lines 1161..1171
          src/definitions/modules/progress.js on lines 679..689
          src/definitions/modules/rating.js on lines 283..293
          src/definitions/modules/search.js on lines 1034..1044
          src/definitions/modules/search.js on lines 1045..1055
          src/definitions/modules/shape.js on lines 690..700
          src/definitions/modules/sidebar.js on lines 783..793
          src/definitions/modules/sticky.js on lines 730..740
          src/definitions/modules/sticky.js on lines 741..751
          src/definitions/modules/tab.js on lines 712..722
          src/definitions/modules/transition.js on lines 853..863

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

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

              setting: function(name, value) {
                if( $.isPlainObject(name) ) {
                  $.extend(true, settings, name);
                }
                else if(value !== undefined) {
          Severity: Major
          Found in src/definitions/globals/site.js and 24 other locations - About 1 hr to fix
          src/definitions/behaviors/api.js on lines 860..870
          src/definitions/behaviors/form.js on lines 1037..1047
          src/definitions/behaviors/form.js on lines 1048..1058
          src/definitions/behaviors/visibility.js on lines 1031..1041
          src/definitions/behaviors/visibility.js on lines 1042..1052
          src/definitions/globals/site.js on lines 266..276
          src/definitions/modules/checkbox.js on lines 608..618
          src/definitions/modules/dimmer.js on lines 487..497
          src/definitions/modules/dropdown.js on lines 3531..3541
          src/definitions/modules/embed.js on lines 408..418
          src/definitions/modules/modal.js on lines 787..797
          src/definitions/modules/nag.js on lines 275..285
          src/definitions/modules/popup.js on lines 1150..1160
          src/definitions/modules/popup.js on lines 1161..1171
          src/definitions/modules/progress.js on lines 679..689
          src/definitions/modules/rating.js on lines 283..293
          src/definitions/modules/search.js on lines 1034..1044
          src/definitions/modules/search.js on lines 1045..1055
          src/definitions/modules/shape.js on lines 690..700
          src/definitions/modules/sidebar.js on lines 783..793
          src/definitions/modules/sticky.js on lines 730..740
          src/definitions/modules/sticky.js on lines 741..751
          src/definitions/modules/tab.js on lines 712..722
          src/definitions/modules/transition.js on lines 853..863

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

          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