TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

Function onBrushEventHandler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        var onBrushEventHandler = () => {

            var targetKey = Object.keys(columnsBrushes)
                .find((k) => columnsBrushes[k] === d3Selection.event.target);

Severity: Minor
Found in src/elements/coords.parallel.js - About 1 hr to fix

    Function from has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                return function from(arrayLike/*, mapFn, thisArg */) {
                    var C = this;
                    var items = Object(arrayLike);
                    if (arrayLike == null) {
                        throw new TypeError('Array.from requires an array-like object - not null or undefined');
    Severity: Minor
    Found in src/utils/polyfills.js - About 1 hr to fix

      Function updateTicks has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function updateTicks(ticks: TickDataBinding) {
      
                  take(ticks)
      
                      .then(({tickEnter, tickExit, tick}) => {
      Severity: Minor
      Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

        Function experimentalShouldAnimate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                experimentalShouldAnimate: (spec) => {
                    const createSvg = (tag, attrs) => {
                        var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
                        Object.keys(attrs).forEach((k) => el.setAttribute(k, String(attrs[k])));
                        return el;
        Severity: Minor
        Found in src/tau.charts.ts - About 1 hr to fix

          Function drawLines has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function drawLines(ticks: TickDataBinding) {
                      const ly = (ko * tickSize);
                      const lx = (isOrdinalScale ? ((d) => (kh * scale.stepSize(d) / 2)) : null);
          
                      take(ticks)
          Severity: Minor
          Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

            Function create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                create() {
            
                    var props = this.scaleConfig;
                    var varSet = this.vars;
            
            
            Severity: Minor
            Found in src/scales/size.ts - About 1 hr to fix

              Function get has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  get: (typeName, settings, srcSpec, fnCreateScale) => {
              
                      var engine = (SpecEngineTypeMap[typeName] || SpecEngineTypeMap.NONE);
              
                      var meta: EngineMeta = {
              Severity: Minor
              Found in src/spec-transform-auto-layout.ts - About 1 hr to fix

                Function create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    create(interval: [number, number]) {
                
                        var props = this.scaleConfig;
                        var varSet = this.vars;
                
                
                Severity: Minor
                Found in src/scales/ordinal.ts - About 1 hr to fix

                  Function ruleApplyDefaults has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ruleApplyDefaults(spec: GPLSpec) {
                  
                          var settings = spec.settings || {};
                  
                          var traverse = (node, iterator, parentNode) => {
                  Severity: Minor
                  Found in src/spec-converter.ts - About 1 hr to fix

                    Function validateAxis has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function validateAxis(dimensions: ChartDimensionsMap, axis: string[], axisName: string) {
                        return axis.reduce(function (result, item, index) {
                            var dimension = dimensions[item];
                            if (!dimension) {
                                result.status = status.FAIL;
                    Severity: Minor
                    Found in src/api/converter-helpers.ts - About 1 hr to fix

                      Function _renderRoot has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _renderRoot({scenario, newSize}: {scenario: GrammarElement[]; newSize: Size;}) {
                              const d3Target = d3.select(this._layout.content);
                              var frameRootId = scenario[0].config.uid;
                              var svg = selectOrAppend(d3Target, `svg`)
                                  .attr('width', Math.floor(newSize.width))
                      Severity: Minor
                      Found in src/charts/tau.plot.ts - About 1 hr to fix

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

                        function extendLogScale(scale) {
                            var d3ScaleCopy = scale.copy;
                        
                            // NOTE: D3 log scale ticks count is not configurable
                            // and returns 10 ticks per each exponent.
                        Severity: Minor
                        Found in src/scales/logarithmic.ts - About 1 hr to fix

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

                          export function getStepLine(points: Point[]) {
                              var result: Point[] = [];
                              var hasId = (points[0].id !== undefined);
                              var hasSize = (points[0].size !== undefined);
                              for (var i = 1, p0, p1, m0, m1; i < points.length; i++) {
                          Severity: Minor
                          Found in src/utils/path/interpolators/step.ts - About 1 hr to fix

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

                                    var update = function (elements: d3Selection) {
                                        elements
                                            .style('fill', color)
                                            .style('font-size', `${self.guide.fontSize}px`)
                                            .style('display', ((__, i) => labels[i].hide ? 'none' : null))
                            Severity: Minor
                            Found in src/elements/decorators/layer-labels.ts - About 1 hr to fix

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

                                  var getFacetGroups = (root: Unit) => {
                                      if (root.type === 'COORDS.RECT') {
                                          root.frames.forEach((f) => {
                                              if (f.key) {
                                                  var keys = Object.keys(f.key);
                              Severity: Minor
                              Found in src/spec-transform-calc-size.ts - About 1 hr to fix

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

                                    export function getAxisTickLabelSize(text: string) {
                                        var div = document.createElement('div');
                                        div.style.position = 'absolute';
                                        div.style.visibility = 'hidden';
                                        div.style.width = '100px';
                                Severity: Minor
                                Found in src/utils/utils-dom.ts - About 1 hr to fix

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

                                      _initPointerEvents() {
                                          if (!this._liveSpec.settings.syncPointerEvents) {
                                              this._pointerAnimationFrameId = null;
                                          }
                                          const svg = d3.select(this._svg);
                                  Severity: Minor
                                  Found in src/charts/tau.plot.ts - About 1 hr to fix

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

                                                (memo, f) => {
                                                    var absFiber = f.map((row) => {
                                                        return {
                                                            data: row,
                                                            x: m.x(row) + m.dx(row),
                                    Severity: Minor
                                    Found in src/elements/decorators/layer-labels.ts - About 1 hr to fix

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

                                          buildModel(screenModel) {
                                      
                                              const config = this.node().config;
                                              const guide = config.guide;
                                              const options = config.options;
                                      Severity: Minor
                                      Found in src/elements/element.line.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 normal has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          normal(srcSize, calcSize, specRef, tryOptimizeSpec) {
                                      
                                              const {yFacetCount} = getFacetCount(specRef);
                                              if (yFacetCount > 0) {
                                                  SpecTransformOptimize.facetsLabelsAtTop(specRef.unit, specRef.settings);
                                      Severity: Minor
                                      Found in src/spec-transform-calc-size.ts - 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language