cristiingineru/rabbit

View on GitHub

Showing 31 of 31 total issues

Function Geometry has 564 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function Geometry() {

  var EPSILON = Number.EPSILON || 2.220446049250313e-16,
      PI = Math.PI,
      sin = Math.sin,
Severity: Major
Found in src/geometry.js - About 2 days to fix

    Function CustomMatchers has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
    Open

    export function CustomMatchers(geometry, comparators) {
    
      geometry = geometry || new Geometry();
      comparators = comparators || new Comparators()
    
    
    Severity: Minor
    Found in src/customMatchers.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

    File geometry.getBBox.spec.js has 789 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* global $, describe, it, xit, after, beforeEach, afterEach, expect, jasmine, spyOn */
    /* jshint browser: true*/
    
    import { Geometry } from '../src/geometry.js'
    import '../node_modules/Canteen/build/canteen.min'
    Severity: Major
    Found in spec/geometry.getBBox.spec.js - About 1 day to fix

      File geometry.spec.js has 741 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { Geometry } from '../src/geometry.js'
      
      
      describe('Geometry', () => {
          'use strict';
      Severity: Major
      Found in spec/geometry.spec.js - About 1 day to fix

        Function Geometry has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
        Open

        export function Geometry() {
        
          var EPSILON = Number.EPSILON || 2.220446049250313e-16,
              PI = Math.PI,
              sin = Math.sin,
        Severity: Minor
        Found in src/geometry.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

        File geometry.js has 567 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        "use strict";
        
        
        export function Geometry() {
        
        
        Severity: Major
        Found in src/geometry.js - About 1 day to fix

          File customMatchers.spec.js has 504 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { CustomMatchers } from '../src/customMatchers.js'
          import '../node_modules/Canteen/build/canteen.min'
          
          describe('customMatchers', () => {
            'use strict';
          Severity: Major
          Found in spec/customMatchers.spec.js - About 1 day to fix

            Function CustomMatchers has 183 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function CustomMatchers(geometry, comparators) {
            
              geometry = geometry || new Geometry();
              comparators = comparators || new Comparators()
            
            
            Severity: Major
            Found in src/customMatchers.js - About 7 hrs to fix

              Function go has 151 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var go = function() {
              
                describe('Face', function () {
                  'use strict';
              
              
              Severity: Major
              Found in examples/face/face.spec.js - About 6 hrs to fix

                Function Rabbit has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                export function Rabbit(geometry, matchers, comparators) {
                
                  geometry = geometry || new Geometry();
                  matchers = matchers || new CustomMatchers();
                  comparators = comparators || new Comparators();
                Severity: Minor
                Found in src/rabbit.js - About 5 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 Rabbit has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function Rabbit(geometry, matchers, comparators) {
                
                  geometry = geometry || new Geometry();
                  matchers = matchers || new CustomMatchers();
                  comparators = comparators || new Comparators();
                Severity: Major
                Found in src/rabbit.js - About 3 hrs to fix

                  Function Face has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function Face(ctx, window) {
                  
                      window = window || {requestAnimationFrame: function () {}};
                  
                      var mouth = new Mouth(ctx),
                  Severity: Major
                  Found in examples/face/face.js - About 3 hrs to fix

                    Function Comparators has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function Comparators() {
                    
                    
                      var sameValues = (val1, val2, precision) => {
                        var same = false;
                    Severity: Minor
                    Found in src/comparators.js - 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

                    Function draw_core has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var draw_core = function (opt) {
                    
                          clearCanvas(ctx);
                    
                          if (opt.side === 'left') {
                    Severity: Major
                    Found in examples/face/face.js - About 2 hrs to fix

                      Function exports has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function(config) {
                        config.set({
                      
                          // base path that will be used to resolve all patterns (eg. files, exclude)
                          basePath: '.',
                      Severity: Minor
                      Found in karma.conf.js - About 1 hr to fix

                        Function exports has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function(config) {
                          config.set({
                        
                            // base path that will be used to resolve all patterns (eg. files, exclude)
                            // In order to serve the rabbit build files that are outside the default
                        Severity: Minor
                        Found in examples/face/karma.conf.js - About 1 hr to fix

                          Function Eye has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function Eye(ctx) {
                          
                              this.draw = function (opt) {
                                opt = Object.assign({
                                  cx: 0,
                          Severity: Minor
                          Found in examples/face/eye.js - About 1 hr to fix

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

                                this.draw = function (opt) {
                                  opt = Object.assign({
                                    cx: 0,
                                    cy: 0,
                                    width: 10,
                            Severity: Minor
                            Found in examples/face/eye.js - About 1 hr to fix

                              Function Mouth has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function Mouth(ctx) {
                              
                                  this.draw = function(opt) {
                                    opt = Object.assign({
                                      cx: 20,
                              Severity: Minor
                              Found in examples/face/mouth.js - About 1 hr to fix

                                Function Comparators has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function Comparators() {
                                
                                
                                  var sameValues = (val1, val2, precision) => {
                                    var same = false;
                                Severity: Minor
                                Found in src/comparators.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language