|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 2686 (0xa7e)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
separate (Compilation_Unit.Produce_Metrics)
task body Mccabe_State_Machine is
--=============================================================
-- This task body gives the user the ability to either modify =
-- or find out the present state of McCabe's abstract =
-- state machine. Accept statements are provided to change the=
-- present state by adding a delta value (the delta value =
-- supplied an a paramenter can be positive or negative) to =
-- the object stored in the body. A user may find out the =
-- present state of the machine with a rendezvous with the =
-- Get_Cyclomatic_Complexity accept statement. =
-- =
-- written by GER with help from Brad and JM =
--=============================================================
Current_Pi_Count : Mccabe_Predicates.Count := 0;
-- McCabe's current count of decision points
Current_Cyclomatic_Complexity_Count : Mccabe_Vg.Number := 1;
-- McCabe's current count of v(G) for this compilation unit
Delta_Pi : Integer; --**
-- The delta value to add to the present state of McCabe's
-- cyclomatic complexity number
begin
-- McCabe_State_Machine
Calculate_And_Get:
loop
select
-- Modify the present value of PI
accept Change_Pi (The_Amount_To_Change : in Integer := 1) do
Delta_Pi := The_Amount_To_Change;
end Change_Pi;
Mccabe_Predicates.Change
(Pi => Current_Pi_Count, With_Delta => Delta_Pi);
or
-- Calculate McCabe's cyclomatic complexity
accept Calculate_Vg;
Mccabe_Vg.Of_Any_Program_Unit
(Pi => Current_Pi_Count,
Vg => Current_Cyclomatic_Complexity_Count);
or
-- Return the present value of PI
accept Get_Pi (Pi : out Mccabe_Predicates.Count) do
Pi := Current_Pi_Count;
end Get_Pi;
or
-- Return the present value of the cyclomatic complexity
accept Get_Cyclomatic_Complexity
(Cyclomatic_Complexity : out Mccabe_Vg.Number) do
Cyclomatic_Complexity :=
Current_Cyclomatic_Complexity_Count;
end Get_Cyclomatic_Complexity;
or
-- Terminate this task
terminate;
end select;
end loop Calculate_And_Get;
end Mccabe_State_Machine;