pivotal/jasmine

View on GitHub

Showing 309 of 450 total issues

File jasmine.js has 3806 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
Copyright (c) 2008-2018 Pivotal Labs

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Severity: Major
Found in lib/jasmine-core/jasmine.js - About 1 wk to fix

    Function matchersUtil has a Cognitive Complexity of 230 (exceeds 5 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().matchersUtil = function(j$) {
      // TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
    
      return {
        equals: equals,
    Severity: Minor
    Found in src/core/matchers/matchersUtil.js - About 4 days 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 matchersUtil has a Cognitive Complexity of 228 (exceeds 5 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().matchersUtil = function(j$) {
      // TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
    
      return {
        equals: equals,
    Severity: Minor
    Found in lib/jasmine-core/jasmine.js - About 4 days 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 HtmlReporter has a Cognitive Complexity of 151 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmineRequire.HtmlReporter = function(j$) {
    
      var noopTimer = {
        start: function() {},
        elapsed: function() { return 0; }
    Severity: Minor
    Found in src/html/HtmlReporter.js - About 3 days 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 HtmlReporter has a Cognitive Complexity of 151 (exceeds 5 allowed). Consider refactoring.
    Open

    jasmineRequire.HtmlReporter = function(j$) {
    
      var noopTimer = {
        start: function() {},
        elapsed: function() { return 0; }
    Severity: Minor
    Found in lib/jasmine-core/jasmine-html.js - About 3 days 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 Env has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().Env = function(j$) {
      /**
       * _Note:_ Do not construct this directly, Jasmine will make one during booting.
       * @name Env
       * @classdesc The Jasmine environment
    Severity: Minor
    Found in src/core/Env.js - About 2 days 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 Env has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().Env = function(j$) {
      /**
       * _Note:_ Do not construct this directly, Jasmine will make one during booting.
       * @name Env
       * @classdesc The Jasmine environment
    Severity: Minor
    Found in lib/jasmine-core/jasmine.js - About 2 days 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 Env has 480 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().Env = function(j$) {
      /**
       * _Note:_ Do not construct this directly, Jasmine will make one during booting.
       * @name Env
       * @classdesc The Jasmine environment
    Severity: Major
    Found in src/core/Env.js - About 2 days to fix

      Function Env has 480 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      getJasmineRequireObj().Env = function(j$) {
        /**
         * _Note:_ Do not construct this directly, Jasmine will make one during booting.
         * @name Env
         * @classdesc The Jasmine environment
      Severity: Major
      Found in lib/jasmine-core/jasmine.js - About 2 days to fix

        Function Env has 477 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function Env(options) {
            options = options || {};
        
            var self = this;
            var global = options.global || j$.getGlobal();
        Severity: Major
        Found in src/core/Env.js - About 2 days to fix

          Function Env has 477 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function Env(options) {
              options = options || {};
          
              var self = this;
              var global = options.global || j$.getGlobal();
          Severity: Major
          Found in lib/jasmine-core/jasmine.js - About 2 days to fix

            Function pp has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
            Open

            getJasmineRequireObj().pp = function(j$) {
            
              function PrettyPrinter() {
                this.ppNestLevel_ = 0;
                this.seen = [];
            Severity: Minor
            Found in src/core/PrettyPrinter.js - About 2 days 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 pp has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
            Open

            getJasmineRequireObj().pp = function(j$) {
            
              function PrettyPrinter() {
                this.ppNestLevel_ = 0;
                this.seen = [];
            Severity: Minor
            Found in lib/jasmine-core/jasmine.js - About 2 days 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 matchersUtil has 379 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            getJasmineRequireObj().matchersUtil = function(j$) {
              // TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
            
              return {
                equals: equals,
            Severity: Major
            Found in src/core/matchers/matchersUtil.js - About 1 day to fix

              Function matchersUtil has 379 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              getJasmineRequireObj().matchersUtil = function(j$) {
                // TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
              
                return {
                  equals: equals,
              Severity: Major
              Found in lib/jasmine-core/jasmine.js - About 1 day to fix

                Function HtmlReporter has 336 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jasmineRequire.HtmlReporter = function(j$) {
                
                  var noopTimer = {
                    start: function() {},
                    elapsed: function() { return 0; }
                Severity: Major
                Found in src/html/HtmlReporter.js - About 1 day to fix

                  Function HtmlReporter has 336 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jasmineRequire.HtmlReporter = function(j$) {
                  
                    var noopTimer = {
                      start: function() {},
                      elapsed: function() { return 0; }
                  Severity: Major
                  Found in lib/jasmine-core/jasmine-html.js - About 1 day to fix

                    Function toThrowError has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                    Open

                    getJasmineRequireObj().toThrowError = function(j$) {
                    
                      var getErrorMsg =  j$.formatErrorMsg('<toThrowError>', 'expect(function() {<expectation>}).toThrowError(<ErrorConstructor>, <message>)');
                    
                      /**
                    Severity: Minor
                    Found in src/core/matchers/toThrowError.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 HtmlReporter has 299 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function HtmlReporter(options) {
                        var env = options.env || {},
                          getContainer = options.getContainer,
                          createElement = options.createElement,
                          createTextNode = options.createTextNode,
                    Severity: Major
                    Found in src/html/HtmlReporter.js - About 1 day to fix

                      Function HtmlReporter has 299 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function HtmlReporter(options) {
                          var env = options.env || {},
                            getContainer = options.getContainer,
                            createElement = options.createElement,
                            createTextNode = options.createTextNode,
                      Severity: Major
                      Found in lib/jasmine-core/jasmine-html.js - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language