codenautas/js-to-html

View on GitHub

Showing 180 of 180 total issues

File js-to-html.ts has 1821 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

var SCRIPT_IS_VOID = true;

export function setScriptIsVoid(is:boolean){
Severity: Major
Found in src/js-to-html.ts - About 4 days to fix

    html has 120 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export var html={
        defaultTitle:"",
        insecureModeEnabled:true,
        mandatoryTitle:true,
        optimizingArrange:true,
    Severity: Major
    Found in src/js-to-html.ts - About 2 days to fix

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

          "disabled": {
              "tags": {
                  "button": {"description": "Whether the form control is disabled","value": "Boolean attribute"},
                  "menuitem": {"description": "Whether the form control is disabled","value": "Boolean attribute"},
                  "fieldset": {"description": "Whether the form control is disabled","value": "Boolean attribute"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 6 hrs to fix
      src/js-to-html.ts on lines 1228..1241
      src/js-to-html.ts on lines 1707..1720

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

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

          "src": {
              "tags": {
                  "audio": {"description": "Address of the resource","value": "Valid non-empty URL potentially surrounded by spaces"},
                  "embed": {"description": "Address of the resource","value": "Valid non-empty URL potentially surrounded by spaces"},
                  "iframe": {"description": "Address of the resource","value": "Valid non-empty URL potentially surrounded by spaces"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 6 hrs to fix
      src/js-to-html.ts on lines 1181..1194
      src/js-to-html.ts on lines 1228..1241

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

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

          "form": {
              "tags": {
                  "button": {"description": "Associates the control with a form element","value": "ID*"},
                  "fieldset": {"description": "Associates the control with a form element","value": "ID*"},
                  "input": {"description": "Associates the control with a form element","value": "ID*"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 6 hrs to fix
      src/js-to-html.ts on lines 1181..1194
      src/js-to-html.ts on lines 1707..1720

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

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

          "title": {
              "tags": {
                  "HTML elements": {"description": "Advisory information for the element","value": "Text"},
                  "abbr": {"description": "Full term or expansion of abbreviation","value": "Text"},
                  "dfn": {"description": "Full term or expansion of abbreviation","value": "Text"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 4 hrs to fix
      src/js-to-html.ts on lines 1284..1295
      src/js-to-html.ts on lines 1834..1845

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

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

          "height": {
              "tags": {
                  "canvas": {"description": "Vertical dimension","value": "Valid non-negative integer"},
                  "embed": {"description": "Vertical dimension","value": "Valid non-negative integer"},
                  "iframe": {"description": "Vertical dimension","value": "Valid non-negative integer"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 4 hrs to fix
      src/js-to-html.ts on lines 1773..1784
      src/js-to-html.ts on lines 1834..1845

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

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

          "width": {
              "tags": {
                  "canvas": {"description": "Horizontal dimension","value": "Valid non-negative integer"},
                  "embed": {"description": "Horizontal dimension","value": "Valid non-negative integer"},
                  "iframe": {"description": "Horizontal dimension","value": "Valid non-negative integer"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 4 hrs to fix
      src/js-to-html.ts on lines 1284..1295
      src/js-to-html.ts on lines 1773..1784

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

      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

      Function toHtmlDoc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          toHtmlDoc(opts:PrintOpts,recurseOpts:PrintRecurseOpts){
              opts = opts||{};
              var target:Html=this;
              if(!opts.incomplete){
                  var source:Html=this;
      Severity: Minor
      Found in src/js-to-html.ts - About 3 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

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

          "crossorigin": {
              "tags": {
                  "audio": {"description": "How the element handles crossorigin requests","value": "\"anonymous\"; \"use-credentials\""},
                  "img": {"description": "How the element handles crossorigin requests","value": "\"anonymous\"; \"use-credentials\""},
                  "link": {"description": "How the element handles crossorigin requests","value": "\"anonymous\"; \"use-credentials\""},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 3 hrs to fix
      src/js-to-html.ts on lines 1031..1040
      src/js-to-html.ts on lines 1397..1406

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

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

          "label": {
              "tags": {
                  "menuitem": {"description": "User-visible label","value": "Text"},
                  "menu": {"description": "User-visible label","value": "Text"},
                  "optgroup": {"description": "User-visible label","value": "Text"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 3 hrs to fix
      src/js-to-html.ts on lines 1031..1040
      src/js-to-html.ts on lines 1130..1139

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

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

          "autofocus": {
              "tags": {
                  "button": {"description": "Automatically focus the form control when the page is loaded","value": "Boolean attribute"},
                  "input": {"description": "Automatically focus the form control when the page is loaded","value": "Boolean attribute"},
                  "keygen": {"description": "Automatically focus the form control when the page is loaded","value": "Boolean attribute"},
      Severity: Major
      Found in src/js-to-html.ts and 2 other locations - About 3 hrs to fix
      src/js-to-html.ts on lines 1130..1139
      src/js-to-html.ts on lines 1397..1406

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

      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

      File tagInterface.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      
      var fs=require('fs').promises;
      
      // https://html.spec.whatwg.org/multipage/indices.html#element-interfaces
      
      Severity: Minor
      Found in generators/tagInterface.js - About 2 hrs to fix

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

        export interface Attr4HTMLButtonElement extends Attr4HTMLElement {autofocus?:any,disabled?:any,form?:any,formaction?:any,formenctype?:any,formmethod?:any,formnovalidate?:any,formtarget?:any,name?:any,type?:any,value?:any,}
        Severity: Major
        Found in src/js-to-html.ts and 1 other location - About 2 hrs to fix
        src/js-to-html.ts on lines 104..104

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function indirect has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        function indirect(tagName:string,contentOrAttributes?:Content|object,contentIfThereAreAttributes?:Content){
            var attributes:object={};
            var content:Content=[];
            if(typeof contentOrAttributes=="object" && !(contentOrAttributes instanceof Array) ){
                if(contentOrAttributes!=null){
        Severity: Minor
        Found in src/js-to-html.ts - About 2 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

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

        export interface Attr4HTMLVideoElement extends Attr4HTMLElement {src?:any,crossorigin?:any,poster?:any,preload?:any,autoplay?:any,playsinline?:any,loop?:any,muted?:any,controls?:any,width?:any,height?:any,}
        Severity: Major
        Found in src/js-to-html.ts and 1 other location - About 2 hrs to fix
        src/js-to-html.ts on lines 47..47

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function arrange has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function arrange(element:HTMLElement|SVGElement, listOfObjects:HtmlBase|HtmlBase[]):void{
            if(!(listOfObjects instanceof Array)){
                return arrange(element, [listOfObjects]);
            }
            // @ts-ignore
        Severity: Major
        Found in src/js-to-html.ts - About 2 hrs to fix

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

          export interface Attr4HTMLIFrameElement extends Attr4HTMLElement {src?:any,srcdoc?:any,name?:any,sandbox?:any,allowfullscreen?:any,allowpaymentrequest?:any,allowusermedia?:any,width?:any,height?:any,referrerpolicy?:any,}
          Severity: Major
          Found in src/js-to-html.ts and 2 other locations - About 2 hrs to fix
          src/js-to-html.ts on lines 66..66
          src/js-to-html.ts on lines 71..71

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

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

          export interface Attr4HTMLImageElement extends Attr4HTMLElement {alt?:any,src?:any,srcset?:any,crossorigin?:any,usemap?:any,ismap?:any,width?:any,height?:any,decoding?:any,referrerpolicy?:any,}
          Severity: Major
          Found in src/js-to-html.ts and 2 other locations - About 2 hrs to fix
          src/js-to-html.ts on lines 65..65
          src/js-to-html.ts on lines 71..71

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

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

          export interface Attr4HTMLLinkElement extends Attr4HTMLElement {href?:any,crossorigin?:any,rel?:any,as?:any,media?:any,hreflang?:any,type?:any,sizes?:any,referrerpolicy?:any,integrity?:any,}
          Severity: Major
          Found in src/js-to-html.ts and 2 other locations - About 2 hrs to fix
          src/js-to-html.ts on lines 65..65
          src/js-to-html.ts on lines 66..66

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

          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

          Severity
          Category
          Status
          Source
          Language