stefan-kolb/nucleus

View on GitHub

Showing 116 of 116 total issues

File marked.js has 901 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * marked - a markdown parser
 * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/chjj/marked
 */
Severity: Major
Found in public/swagger-ui/lib/marked.js - About 2 days to fix

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Предупреждение: Устарело",
        "Implementation Notes":"Заметки",
        "Response Class":"Пример ответа",
        "Status":"Статус",
    Severity: Major
    Found in public/swagger-ui/lang/ru.js and 1 other location - About 1 day to fix
    public/swagger-ui/lang/en.js on lines 4..55

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

    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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Warning: Deprecated",
        "Implementation Notes":"Implementation Notes",
        "Response Class":"Response Class",
        "Status":"Status",
    Severity: Major
    Found in public/swagger-ui/lang/en.js and 1 other location - About 1 day to fix
    public/swagger-ui/lang/ru.js on lines 4..55

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

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Uyarı: Deprecated",
        "Implementation Notes":"Gerçekleştirim Notları",
        "Response Class":"Dönen Sınıf",
        "Status":"Statü",
    Severity: Major
    Found in public/swagger-ui/lang/tr.js and 5 other locations - About 1 day to fix
    public/swagger-ui/lang/fr.js on lines 4..53
    public/swagger-ui/lang/ja.js on lines 4..53
    public/swagger-ui/lang/pl.js on lines 4..53
    public/swagger-ui/lang/pt.js on lines 4..53
    public/swagger-ui/lang/zh-cn.js on lines 4..53

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

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Avertissement : Obsolète",
        "Implementation Notes":"Notes d'implementation",
        "Response Class":"Classe de la réponse",
        "Status":"Statut",
    Severity: Major
    Found in public/swagger-ui/lang/fr.js and 5 other locations - About 1 day to fix
    public/swagger-ui/lang/ja.js on lines 4..53
    public/swagger-ui/lang/pl.js on lines 4..53
    public/swagger-ui/lang/pt.js on lines 4..53
    public/swagger-ui/lang/tr.js on lines 4..53
    public/swagger-ui/lang/zh-cn.js on lines 4..53

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

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Uwaga: Wycofane",
        "Implementation Notes":"Uwagi Implementacji",
        "Response Class":"Klasa Odpowiedzi",
        "Status":"Status",
    Severity: Major
    Found in public/swagger-ui/lang/pl.js and 5 other locations - About 1 day to fix
    public/swagger-ui/lang/fr.js on lines 4..53
    public/swagger-ui/lang/ja.js on lines 4..53
    public/swagger-ui/lang/pt.js on lines 4..53
    public/swagger-ui/lang/tr.js on lines 4..53
    public/swagger-ui/lang/zh-cn.js on lines 4..53

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

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Aviso: Depreciado",
        "Implementation Notes":"Notas de Implementação",
        "Response Class":"Classe de resposta",
        "Status":"Status",
    Severity: Major
    Found in public/swagger-ui/lang/pt.js and 5 other locations - About 1 day to fix
    public/swagger-ui/lang/fr.js on lines 4..53
    public/swagger-ui/lang/ja.js on lines 4..53
    public/swagger-ui/lang/pl.js on lines 4..53
    public/swagger-ui/lang/tr.js on lines 4..53
    public/swagger-ui/lang/zh-cn.js on lines 4..53

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

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"警告:已过时",
        "Implementation Notes":"实现备注",
        "Response Class":"响应类",
        "Status":"状态",
    Severity: Major
    Found in public/swagger-ui/lang/zh-cn.js and 5 other locations - About 1 day to fix
    public/swagger-ui/lang/fr.js on lines 4..53
    public/swagger-ui/lang/ja.js on lines 4..53
    public/swagger-ui/lang/pl.js on lines 4..53
    public/swagger-ui/lang/pt.js on lines 4..53
    public/swagger-ui/lang/tr.js on lines 4..53

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

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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"警告: 廃止予定",
        "Implementation Notes":"実装メモ",
        "Response Class":"レスポンスクラス",
        "Status":"ステータス",
    Severity: Major
    Found in public/swagger-ui/lang/ja.js and 5 other locations - About 1 day to fix
    public/swagger-ui/lang/fr.js on lines 4..53
    public/swagger-ui/lang/pl.js on lines 4..53
    public/swagger-ui/lang/pt.js on lines 4..53
    public/swagger-ui/lang/tr.js on lines 4..53
    public/swagger-ui/lang/zh-cn.js on lines 4..53

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

    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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Attenzione: Deprecato",
        "Implementation Notes":"Note di implementazione",
        "Response Class":"Classe della risposta",
        "Status":"Stato",
    Severity: Major
    Found in public/swagger-ui/lang/it.js and 1 other location - About 1 day to fix
    public/swagger-ui/lang/es.js on lines 4..52

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

    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

    window.SwaggerTranslator.learn({
        "Warning: Deprecated":"Advertencia: Obsoleto",
        "Implementation Notes":"Notas de implementación",
        "Response Class":"Clase de la Respuesta",
        "Status":"Status",
    Severity: Major
    Found in public/swagger-ui/lang/es.js and 1 other location - About 1 day to fix
    public/swagger-ui/lang/it.js on lines 4..52

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

    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 token has 213 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Lexer.prototype.token = function(src, top, bq) {
      var src = src.replace(/^ +$/gm, '')
        , next
        , loose
        , cap
    Severity: Major
    Found in public/swagger-ui/lib/marked.js - About 1 day to fix

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

            for (i = 0; i < item.align.length; i++) {
              if (/^ *-+: *$/.test(item.align[i])) {
                item.align[i] = 'right';
              } else if (/^ *:-+: *$/.test(item.align[i])) {
                item.align[i] = 'center';
      Severity: Major
      Found in public/swagger-ui/lib/marked.js and 1 other location - About 6 hrs to fix
      public/swagger-ui/lib/marked.js on lines 218..228

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

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

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

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

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

      Refactorings

      Further Reading

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

            for (i = 0; i < item.align.length; i++) {
              if (/^ *-+: *$/.test(item.align[i])) {
                item.align[i] = 'right';
              } else if (/^ *:-+: *$/.test(item.align[i])) {
                item.align[i] = 'center';
      Severity: Major
      Found in public/swagger-ui/lib/marked.js and 1 other location - About 6 hrs to fix
      public/swagger-ui/lib/marked.js on lines 389..399

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

      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 handleLogin has 147 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function handleLogin() {
        var scopes = [];
      
        var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
        if(auths) {
      Severity: Major
      Found in public/swagger-ui/lib/swagger-oauth.js - About 5 hrs to fix

        Class Stub has 37 methods (exceeds 20 allowed). Consider refactoring.
        Open

              class Stub < BaseAdapter
                # Error message saying that the adapter feature has not been implemented yet.
                NOT_IMPLEMENTED_ERROR = Errors::AdapterMissingImplementationError.new(
                  'Adapter is missing an implementation to support this feature'
                )
        Severity: Minor
        Found in lib/nucleus/adapters/v1/stub_adapter.rb - About 4 hrs to fix

          Function handleLogin has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

          function handleLogin() {
            var scopes = [];
          
            var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
            if(auths) {
          Severity: Minor
          Found in public/swagger-ui/lib/swagger-oauth.js - About 4 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 output has 105 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          InlineLexer.prototype.output = function(src) {
            var out = ''
              , link
              , text
              , href
          Severity: Major
          Found in public/swagger-ui/lib/marked.js - About 4 hrs to fix

            Function tok has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Parser.prototype.tok = function() {
              switch (this.token.type) {
                case 'space': {
                  return '';
                }
            Severity: Major
            Found in public/swagger-ui/lib/marked.js - About 3 hrs to fix

              Method update_fields has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                    def update_fields(entity, entity_documentation, fields)
                      # update all fields, but only with allowed values (according to the doc)
                      unless fields.nil?
                        fields.each do |key, value|
                          # only continue if the value can be assigned to the entity
              Severity: Minor
              Found in lib/nucleus_api/api/helpers/form_processing_helper.rb - 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

              Severity
              Category
              Status
              Source
              Language