phadej/relaxed-json

View on GitHub

Showing 6 of 6 total issues

File relaxed-json.js has 456 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
  Copyright (c) 2013, Oleg Grenrus
  All rights reserved.

  Redistribution and use in source and binary forms, with or without
Severity: Minor
Found in relaxed-json.js - About 6 hrs to fix

    Function parsePair has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function parsePair(tokens, state, obj) {
        var token = skipPunctuation(tokens, state, [":"]);
        var key;
        var value;
    
    
    Severity: Minor
    Found in relaxed-json.js - About 1 hr to fix

      Function parseMany has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function parseMany(tokens, state, obj, opts) {
          var token = skipPunctuation(tokens, state, opts.skip);
      
          if (token.type === "eof") {
            raiseUnexpected(state, token, "'" + opts.endSymbol + "' or " + opts.elementName);
      Severity: Minor
      Found in relaxed-json.js - About 1 hr to fix

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

          function makeLexer(tokenSpecs) {
            // :: string -> array token
            return function (contents) {
              var tokens = [];
              var line = 1;
        Severity: Minor
        Found in relaxed-json.js - About 1 hr to fix

          Function parse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function parse(text, opts) {
              if (typeof opts === "function" || opts === undefined) {
                return JSON.parse(transform(text), opts);
              } else if (new Object(opts) !== opts) { // eslint-disable-line no-new-object
                throw new TypeError("opts/reviver should be undefined, a function or an object");
          Severity: Minor
          Found in relaxed-json.js - About 1 hr to fix

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

              function makeTokenSpecs(relaxed) {
                // :: string -> fn
                function f(type) {
                  // :: tuple string -> rawToken
                  return function (m) {
            Severity: Minor
            Found in relaxed-json.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language