phodal/congee

View on GitHub
scripts/libs/text.js

Summary

Maintainability
C
1 day
Test Coverage

Function parseName has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        parseName: function (name) {
            var modName, ext, temp,
                strip = false,
                index = name.indexOf("."),
                isRelative = name.indexOf('./') === 0 ||
Severity: Minor
Found in scripts/libs/text.js - About 1 hr to fix

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

            text.get = function (url, callback, errback, headers) {
                var xhr = text.createXhr(), header;
                xhr.open('GET', url, true);
    
                //Allow plugins direct access to xhr headers
    Severity: Minor
    Found in scripts/libs/text.js - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                          if (headers.hasOwnProperty(header)) {
                              xhr.setRequestHeader(header.toLowerCase(), headers[header]);
                          }
      Severity: Major
      Found in scripts/libs/text.js - About 45 mins to fix

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

                writeFile: function (pluginName, moduleName, req, write, config) {
        Severity: Minor
        Found in scripts/libs/text.js - About 35 mins to fix

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

                      var stringBuffer, line,
                          encoding = "utf-8",
                          file = new java.io.File(url),
                          lineSeparator = java.lang.System.getProperty("line.separator"),
                          input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
          Severity: Major
          Found in scripts/libs/text.js and 1 other location - About 3 hrs to fix
          scripts/libs/rv.js on lines 163..167

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

          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 < 3; i += 1) {
                              progId = progIds[i];
                              try {
                                  xhr = new ActiveXObject(progId);
                              } catch (e) {}
          Severity: Major
          Found in scripts/libs/text.js and 1 other location - About 1 hr to fix
          scripts/libs/rv.js on lines 105..115

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 61.

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

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

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

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

          Refactorings

          Further Reading

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

                          if (line && line.length() && line.charAt(0) === 0xfeff) {
                              // Eat the BOM, since we've already found the encoding on this file,
                              // and we plan to concatenating this buffer with others; the BOM should
                              // only appear at the top of a file.
                              line = line.substring(1);
          Severity: Major
          Found in scripts/libs/text.js and 1 other location - About 1 hr to fix
          scripts/libs/rv.js on lines 175..180

          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

                          while ((line = input.readLine()) !== null) {
                              stringBuffer.append(lineSeparator);
                              stringBuffer.append(line);
                          }
          Severity: Minor
          Found in scripts/libs/text.js and 1 other location - About 35 mins to fix
          scripts/libs/rv.js on lines 182..185

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

          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