hannahhoward/a1atscript

View on GitHub

Showing 5 of 27 total issues

Function setupProperty has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setupProperty(key, properties) {
    properties[STRING_PREFIX + key] = "@" + this.bindObj[key];
    properties[BIND_PREFIX + key] = "=?bind" + this.bindObj[key][0].toUpperCase() + this.bindObj[key].slice(1);


Severity: Minor
Found in src/a1atscript/ng2Directives/PropertiesBuilder.js - About 1 hr to fix

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

      _sortDependency(dependency, checkModule = true) {
        var sorted = {};
    
        if (typeof dependency === "string" || dependency instanceof Module) {
          sorted.module = [dependency];
    Severity: Minor
    Found in src/a1atscript/Injector.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 exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(config) {
    
      var isWebstorm = /karma-intellij/.test(process.argv[1]);
      var files;
    
    
    Severity: Minor
    Found in karma.conf.js - About 1 hr to fix

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

      export function ToAnnotation(AnnotationClass) {
        var decorator = function(...callParams) {
          if (this instanceof decorator) {
            return new AnnotationClass(...callParams)
          } else {
      Severity: Minor
      Found in src/a1atscript/ToAnnotation.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 _getComponentName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        _getComponentName(component) {
          var componentAnnotation = (new AnnotationFinder(component)).annotationFor(Component);
          if (componentAnnotation) {
            if (componentAnnotation.controllerAs) {
              return componentAnnotation.controllerAs;
      Severity: Minor
      Found in src/a1atscript/router/ComponentMapper.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

      Severity
      Category
      Status
      Source
      Language