TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

Function optimizeXAxisLabel has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    static optimizeXAxisLabel(root: Unit, settings: ChartSettings) {
        const {xAxisTickLabelLimit} = settings;

        const enterSpec = (rootUnit: Unit) => {

Severity: Minor
Found in src/spec-transform-optimize.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

Function hideAxisTicks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    static hideAxisTicks(root: Unit, settings: ChartSettings, axis: 'x' | 'y') {
        const enterSpec = (rootUnit: Unit) => {
            const pad = (axis === 'x' ? 'b' : 'l');
            const g = rootUnit.guide;

Severity: Minor
Found in src/spec-transform-optimize.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

Function constructor has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(xSource: DataFrame, scaleConfig: ScaleConfig) {

        super(xSource, scaleConfig);

        var discrete = (scaleConfig.dimType !== 'measure');
Severity: Minor
Found in src/scales/color.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

Function extractFieldsFormatInfo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    static extractFieldsFormatInfo(spec: GPLSpec) {

        var specScales = spec.scales;

        var isEmptyScale = function (key: string) {
Severity: Minor
Found in src/plugins-sdk.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

Function buildModel has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    buildModel(screenModel) {

        const baseModel = BasePath.baseModel(screenModel);

        const guide = this.node().config.guide;
Severity: Minor
Found in src/elements/element.area.ts - About 1 hr to fix

    Function generateRatioFunction has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        export function generateRatioFunction(dimPropName: string, paramsList: string[], chartInstanceRef: Plot) {
    
            var unify = (v) => isDate(v) ? v.getTime() : v;
    
            var dataNewSnap = 0;
    Severity: Minor
    Found in src/utils/utils.ts - About 1 hr to fix

      Function template has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          export function template(text: string, settings?, oldSettings?): (data?) => string {
              if (!settings && oldSettings) {
                  settings = oldSettings;
              }
              settings = defaults({}, settings, templateSettings);
      Severity: Minor
      Found in src/utils/utils.ts - About 1 hr to fix

        Function niceZeroBased has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            export function niceZeroBased(domain: number[]) {
        
                var m = 10;
        
                var low = parseFloat(Math.min(...domain).toFixed(15));
        Severity: Minor
        Found in src/utils/utils.ts - About 1 hr to fix

          Function getDrawScenarioQueue has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getDrawScenarioQueue(root: GrammarElement) {
                  const grammarRules = this.grammarRules;
                  var scaleInfoQueue = this._flattenDrawScenario(root, (parentInstance, unit, rootFrame) => {
                      // Rule to cancel parent frame inheritance
                      const frame = (unit.expression.inherit === false) ? null : rootFrame;
          Severity: Minor
          Found in src/charts/tau.gpl.ts - About 1 hr to fix

            Function _flattenDrawScenario has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _flattenDrawScenario(
                    root: GrammarElement,
                    iterator: (parentInstance: GrammarElement, unit: Unit, rootFrame: DataFrame) => GrammarElement
                ) {
            
            
            Severity: Minor
            Found in src/charts/tau.gpl.ts - About 1 hr to fix

              Function auto has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      auto: (config) => {
                          var xs = config.x;
                          var ys = config.y;
                          var primaryX = xs[xs.length - 1];
                          var secondaryX = xs.slice(0, xs.length - 1);
              Severity: Minor
              Found in src/api/chart-area.ts - About 1 hr to fix

                Function ruleInferExpression has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ruleInferExpression(srcUnit: Unit) {
                
                        var expr = {
                            operator: 'none',
                            params: []
                Severity: Minor
                Found in src/spec-converter.ts - About 1 hr to fix

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

                  function getCirclesCurveTangents(a: Point, ca: Point, cb: Point, b: Point) {
                      var d = dist(a, b);
                      if (d === 0 ||
                          (d + a.size / 2 <= b.size / 2) ||
                          (d + b.size / 2 <= a.size / 2)
                  Severity: Minor
                  Found in src/utils/path/svg/brush-line.ts - About 1 hr to fix

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

                        isYFunctionOfX: (data: any[], xFields: string[], yFields: string[]) => {
                            var isRelationAFunction = true;
                            var error: {type: string; keyX: string; keyY: string; valX: string; errY: [string, string]} = null;
                            // domain should has only 1 value from range
                            try {
                    Severity: Minor
                    Found in src/data-processor.ts - About 1 hr to fix

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

                              auto: (config) => {
                                  var xs = config.x;
                                  var ys = config.y;
                                  var primaryX = xs[xs.length - 1];
                                  var secondaryX = xs.slice(0, xs.length - 1);
                      Severity: Minor
                      Found in src/api/chart-line.ts - About 1 hr to fix

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

                            sortByDim: function (data: any[], dimName: string, dimInfo: Dimension) {
                                var rows = data;
                        
                                var interceptor = (['period', 'time'].indexOf(dimInfo.scale) >= 0) ?
                                    (x => new Date(x)) :
                        Severity: Minor
                        Found in src/data-processor.ts - About 1 hr to fix

                          Function ruleInferExpression has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                              ruleInferExpression(srcUnit: Unit) {
                          
                                  var expr = {
                                      operator: 'none',
                                      params: []
                          Severity: Minor
                          Found in src/spec-converter.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

                          Function selectOrAppend has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                              export function selectOrAppend(_container: Element | d3Selection, selector: string) {
                                  var delimitersActions = {
                                      '.': (text, el) => el.classed(text, true),
                                      '#': (text, el) => el.attr('id', text)
                                  };
                          Severity: Minor
                          Found in src/utils/utils-dom.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

                          Function constructor has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              constructor(xSource: DataFrame, scaleConfig: ScaleConfig) {
                          
                                  super(xSource, scaleConfig);
                          
                                  var props = this.scaleConfig;
                          Severity: Minor
                          Found in src/scales/time.ts - About 1 hr to fix

                            Function d3_createPathTween has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var d3_createPathTween = (
                                attr,
                                pathStringBuilder,
                                pointConvertors,
                                idGetter,
                            Severity: Minor
                            Found in src/utils/d3-decorators.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language