michielbdejong/solid-ui

View on GitHub
src/widgets/forms.js

Summary

Maintainability
F
2 wks
Test Coverage

File forms.js has 1645 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*       F O R M S
 *
 *      A Vanilla Dom implementation of the form language
 */

Severity: Major
Found in src/widgets/forms.js - About 4 days to fix

    Function makeSelectForOptions has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
    Open

    forms.makeSelectForOptions = function (
      dom,
      kb,
      subject,
      predicate,
    Severity: Minor
    Found in src/widgets/forms.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function buildCheckboxForm has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

    function buildCheckboxForm (dom, kb, lab, del, ins, form, store, tristate) {
      // 20190115
      var box = dom.createElement('div')
      var tx = dom.createTextNode(lab)
      var editable = UI.store.updater.editable(store.uri)
    Severity: Minor
    Found in src/widgets/forms.js - About 7 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function makeSelectForOptions has 170 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    forms.makeSelectForOptions = function (
      dom,
      kb,
      subject,
      predicate,
    Severity: Major
    Found in src/widgets/forms.js - About 6 hrs to fix

      Function basicField has 134 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function basicField (
        dom,
        container,
        already,
        subject,
      Severity: Major
      Found in src/widgets/forms.js - About 5 hrs to fix

        Function buildCheckboxForm has 115 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function buildCheckboxForm (dom, kb, lab, del, ins, form, store, tristate) {
          // 20190115
          var box = dom.createElement('div')
          var tx = dom.createTextNode(lab)
          var editable = UI.store.updater.editable(store.uri)
        Severity: Major
        Found in src/widgets/forms.js - About 4 hrs to fix

          Function renderItem has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function renderItem (object) {
              async function deleteThisItem () {
                if (ordered) {
                  console.log('pre delete: ' + debugString(list.elements))
                  for (let i = 0; i < list.elements.length; i++) {
          Severity: Major
          Found in src/widgets/forms.js - About 3 hrs to fix

            Function onChange has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var onChange = function (_e) {
                select.disabled = true // until data written back - gives user feedback too
                var ds = []
                var is = []
                var removeValue = function (t) {
            Severity: Major
            Found in src/widgets/forms.js - About 3 hrs to fix

              Function makeDescription has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              forms.makeDescription = function (
                dom,
                kb,
                subject,
                predicate,
              Severity: Major
              Found in src/widgets/forms.js - About 3 hrs to fix

                Function promptForNew has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                forms.promptForNew = function (
                  dom,
                  kb,
                  subject,
                  predicate,
                Severity: Major
                Found in src/widgets/forms.js - About 2 hrs to fix

                  Function boxHandler has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    var boxHandler = function (_e) {
                      tx.style = 'color: #bbb;' // grey -- not saved yet
                      var toDelete = input.state === true ? ins : input.state === false ? del : []
                      input.newState =
                        input.state === null
                  Severity: Minor
                  Found in src/widgets/forms.js - About 2 hrs to fix

                    Function basicField has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function basicField (
                      dom,
                      container,
                      already,
                      subject,
                    Severity: Minor
                    Found in src/widgets/forms.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function promptForNew has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    forms.promptForNew = function (
                      dom,
                      kb,
                      subject,
                      predicate,
                    Severity: Minor
                    Found in src/widgets/forms.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function makeSelectForCategory has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    forms.makeSelectForCategory = function (
                      dom,
                      kb,
                      subject,
                      category,
                    Severity: Minor
                    Found in src/widgets/forms.js - About 1 hr to fix

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

                      forms.makeSelectForNestedCategory = function (
                        dom,
                        kb,
                        subject,
                        category,
                      Severity: Minor
                      Found in src/widgets/forms.js - About 1 hr to fix

                        Function makeDescription has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        forms.makeDescription = function (
                          dom,
                          kb,
                          subject,
                          predicate,
                        Severity: Minor
                        Found in src/widgets/forms.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function editFormButton has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        forms.editFormButton = function (
                          dom,
                          container,
                          form,
                          store,
                        Severity: Minor
                        Found in src/widgets/forms.js - About 1 hr to fix

                          Function updateMany has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                function updateMany (ds, is, callback) {
                                  var docs = []
                                  is.forEach(st => {
                                    if (!docs.includes(st.why.uri)) docs.push(st.why.uri)
                                  })
                          Severity: Minor
                          Found in src/widgets/forms.js - About 1 hr to fix

                            Function propertiesForClass has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            forms.propertiesForClass = function (kb, c) {
                              var ns = UI.ns
                              var explicit = kb.each(undefined, ns.rdf('range'), c)
                              ;[
                                ns.rdfs('comment'),
                            Severity: Minor
                            Found in src/widgets/forms.js - About 1 hr to fix

                              Function deleteThisItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  async function deleteThisItem () {
                                    if (ordered) {
                                      console.log('pre delete: ' + debugString(list.elements))
                                      for (let i = 0; i < list.elements.length; i++) {
                                        if (list.elements[i].sameTerm(object)) {
                              Severity: Minor
                              Found in src/widgets/forms.js - About 1 hr to fix

                                Function buildCheckboxForm has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                function buildCheckboxForm (dom, kb, lab, del, ins, form, store, tristate) {
                                Severity: Major
                                Found in src/widgets/forms.js - About 1 hr to fix

                                  Function booleanField has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    dom,
                                    container,
                                    already,
                                    subject,
                                    form,
                                  Severity: Major
                                  Found in src/widgets/forms.js - About 1 hr to fix

                                    Function newButton has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      dom,
                                      kb,
                                      subject,
                                      predicate,
                                      theClass,
                                    Severity: Major
                                    Found in src/widgets/forms.js - About 1 hr to fix

                                      Function makeSelectForOptions has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        dom,
                                        kb,
                                        subject,
                                        predicate,
                                        possible,
                                      Severity: Major
                                      Found in src/widgets/forms.js - About 1 hr to fix

                                        Function promptForNew has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          dom,
                                          kb,
                                          subject,
                                          predicate,
                                          theClass,
                                        Severity: Major
                                        Found in src/widgets/forms.js - About 1 hr to fix

                                          Function basicField has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                            dom,
                                            container,
                                            already,
                                            subject,
                                            form,
                                          Severity: Major
                                          Found in src/widgets/forms.js - About 50 mins to fix

                                            Function appendForm has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                              dom,
                                              container,
                                              already,
                                              subject,
                                              form,
                                            Severity: Major
                                            Found in src/widgets/forms.js - About 50 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                  for (p in possibleProperties.dp) possible.push(kb.fromNT(p))
                                              Severity: Major
                                              Found in src/widgets/forms.js - About 45 mins to fix

                                                Function makeSelectForNestedCategory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                  dom,
                                                  kb,
                                                  subject,
                                                  category,
                                                  store,
                                                Severity: Minor
                                                Found in src/widgets/forms.js - About 45 mins to fix

                                                  Function makeDescription has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                    dom,
                                                    kb,
                                                    subject,
                                                    predicate,
                                                    store,
                                                  Severity: Minor
                                                  Found in src/widgets/forms.js - About 45 mins to fix

                                                    Function makeSelectForCategory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                      dom,
                                                      kb,
                                                      subject,
                                                      category,
                                                      store,
                                                    Severity: Minor
                                                    Found in src/widgets/forms.js - About 45 mins to fix

                                                      Function makeSelectForCategory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      forms.makeSelectForCategory = function (
                                                        dom,
                                                        kb,
                                                        subject,
                                                        category,
                                                      Severity: Minor
                                                      Found in src/widgets/forms.js - About 45 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function editFormButton has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                        dom,
                                                        container,
                                                        form,
                                                        store,
                                                        callbackFunction
                                                      Severity: Minor
                                                      Found in src/widgets/forms.js - About 35 mins to fix

                                                        Function makeSelectForNestedCategory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                        forms.makeSelectForNestedCategory = function (
                                                          dom,
                                                          kb,
                                                          subject,
                                                          category,
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js - About 25 mins to fix

                                                        Cognitive Complexity

                                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                        A method's cognitive complexity is based on a few simple rules:

                                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                        • Code is considered more complex for each "break in the linear flow of the code"
                                                        • Code is considered more complex when "flow breaking structures are nested"

                                                        Further reading

                                                        Function booleanField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                        function booleanField (
                                                          dom,
                                                          container,
                                                          already,
                                                          subject,
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js - About 25 mins to fix

                                                        Cognitive Complexity

                                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                        A method's cognitive complexity is based on a few simple rules:

                                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                        • Code is considered more complex for each "break in the linear flow of the code"
                                                        • Code is considered more complex when "flow breaking structures are nested"

                                                        Further reading

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

                                                          } else if (from.sameTerm(ns.owl('DatatypeProperty'))) {
                                                            possibleProperties = buttons.propertyTriage(kb)
                                                            for (p in possibleProperties.dp) possible.push(kb.fromNT(p))
                                                            opts.disambiguate = true
                                                          }
                                                        Severity: Major
                                                        Found in src/widgets/forms.js and 1 other location - About 1 hr to fix
                                                        src/widgets/forms.js on lines 1034..1042

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

                                                        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

                                                          } else if (from.sameTerm(ns.owl('ObjectProperty'))) {
                                                            possibleProperties = buttons.propertyTriage(kb)
                                                            for (p in possibleProperties.op) possible.push(kb.fromNT(p))
                                                            opts.disambiguate = true
                                                          } else if (from.sameTerm(ns.owl('DatatypeProperty'))) {
                                                        Severity: Major
                                                        Found in src/widgets/forms.js and 1 other location - About 1 hr to fix
                                                        src/widgets/forms.js on lines 1038..1042

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

                                                        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

                                                                is.forEach(st => {
                                                                  if (!docs.includes(st.why.uri)) docs.push(st.why.uri)
                                                                })
                                                        Severity: Major
                                                        Found in src/widgets/forms.js and 1 other location - About 1 hr to fix
                                                        src/widgets/forms.js on lines 754..756

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

                                                        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

                                                                ds.forEach(st => {
                                                                  if (!docs.includes(st.why.uri)) docs.push(st.why.uri)
                                                                })
                                                        Severity: Major
                                                        Found in src/widgets/forms.js and 1 other location - About 1 hr to fix
                                                        src/widgets/forms.js on lines 751..753

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

                                                        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

                                                        forms.fieldParams[ns.ui('Comment').uri] = {
                                                          element: 'p',
                                                          style: `padding: 0.1em 1.5em; color: ${UI.style.formHeadingColor}; white-space: pre-wrap;`
                                                        }
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js and 1 other location - About 55 mins to fix
                                                        src/widgets/forms.js on lines 1084..1087

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

                                                        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

                                                        forms.fieldParams[ns.ui('Heading').uri] = {
                                                          element: 'h3',
                                                          style: `font-size: 110%; color: ${UI.style.formHeadingColor};`
                                                        }
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js and 1 other location - About 55 mins to fix
                                                        src/widgets/forms.js on lines 1080..1083

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

                                                        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

                                                        forms.field[ns.ui('BooleanField').uri] = function (
                                                          dom,
                                                          container,
                                                          already,
                                                          subject,
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js and 1 other location - About 50 mins to fix
                                                        src/widgets/forms.js on lines 906..925

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

                                                        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

                                                        forms.field[ns.ui('TristateField').uri] = function (
                                                          dom,
                                                          container,
                                                          already,
                                                          subject,
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js and 1 other location - About 50 mins to fix
                                                        src/widgets/forms.js on lines 885..904

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

                                                        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

                                                            while (sel && sel.currentURI) {
                                                              removeValue(kb.sym(sel.currentURI))
                                                              sel = sel.superSelect
                                                            }
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js and 1 other location - About 35 mins to fix
                                                        src/widgets/forms.js on lines 1672..1675

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

                                                        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

                                                            while (sel && sel.currentURI) {
                                                              removeValue(kb.sym(sel.currentURI))
                                                              sel = sel.subSelect
                                                            }
                                                        Severity: Minor
                                                        Found in src/widgets/forms.js and 1 other location - About 35 mins to fix
                                                        src/widgets/forms.js on lines 1677..1680

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

                                                        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