bendrucker/convex

View on GitHub

Showing 14 of 14 total issues

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

module.exports = function ($q, ConvexRequest, ConvexCache, ConvexBatch, ConvexRelation, ConvexCollection) {

  function ConvexModel (attributes) {
    attributes = attributes || {};
    if (!attributes.id) {
Severity: Major
Found in src/model.js - About 7 hrs to fix

    Function exports has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function ($q, ConvexRequest, ConvexCache, ConvexBatch, ConvexRelation, ConvexCollection) {
    
      function ConvexModel (attributes) {
        attributes = attributes || {};
        if (!attributes.id) {
    Severity: Minor
    Found in src/model.js - About 6 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 exports has 125 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function ($http, $q, $timeout, ConvexCache, convexConfig) {
    
      function ConvexRequest (config) {
        this.config = parseConfig(config);
        this.deferred = $q.defer();
    Severity: Major
    Found in src/request.js - About 5 hrs to fix

      Function exports has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function ($http, $q, $timeout, ConvexCache, convexConfig) {
      
        function ConvexRequest (config) {
          this.config = parseConfig(config);
          this.deferred = $q.defer();
      Severity: Minor
      Found in src/request.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 exports has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function () {
      
        function ConvexCollection (Model, models) {
          this.$$model = Model;
          this.$$models = [];
      Severity: Major
      Found in src/collection.js - About 2 hrs to fix

        Function exports has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function ($injector, ConvexCollection) {
        
          function ConvexRelation (config) {
            this.type = config.type;
            this.key = config.key;
        Severity: Minor
        Found in src/relation.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 exports has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (ConvexRequest, $q, convexConfig) {
        
          function ConvexBatch () {
            this.requests = [];
          }
        Severity: Minor
        Found in src/batch.js - About 1 hr to fix

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

          module.exports = function ($injector, ConvexCollection) {
          
            function ConvexRelation (config) {
              this.type = config.type;
              this.key = config.key;
          Severity: Minor
          Found in src/relation.js - About 1 hr to fix

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

            module.exports = function ($cacheFactory, $window) {
            
              var prefix = 'convex-';
              var localStorage = $window.localStorage || {
                setItem: angular.noop,
            Severity: Minor
            Found in src/cache.js - About 1 hr to fix

              Function $set has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                ConvexModel.prototype.$set = function (attributes) {
                  var model = this;
                  Object.keys(attributes)
                    .filter(function (key) {
                      if (isForeignKey(key) || !hasRelation(model, key)) {
              Severity: Minor
              Found in src/model.js - About 1 hr to fix

                Function exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function () {
                
                  function ConvexCollection (Model, models) {
                    this.$$model = Model;
                    this.$$models = [];
                Severity: Minor
                Found in src/collection.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 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                module.exports = function ($q, ConvexRequest, ConvexCache, ConvexBatch, ConvexRelation, ConvexCollection) {
                Severity: Minor
                Found in src/model.js - About 45 mins to fix

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

                  module.exports = function ($http, $q, $timeout, ConvexCache, convexConfig) {
                  Severity: Minor
                  Found in src/request.js - About 35 mins to fix

                    Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function ($cacheFactory, $window) {
                    
                      var prefix = 'convex-';
                      var localStorage = $window.localStorage || {
                        setItem: angular.noop,
                    Severity: Minor
                    Found in src/cache.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